The on-loan defender from Swansea produced a perfect goal when he hooked home a right-wing corner from Scotland international Chris Burke two minutes into injury time.
A low-key goalless first half, when both sides struggled to create goalscoring opportunities, contrasted sharply to the second period.
Plymouth's best chance of taking the lead in the opening half was a header from Marvin Morgan which produced a quality save from Colin Doyle.
Undoubtedly the miss of the game came two minutes into the second half. Lee Novak squared a pass to Burke who amazingly scooped the ball over the crossbar in front of an open goal.
Fortunately for Birmingham, newcomer Allan was on the mark in the 49th minute when he moved on to a pass from Tom Adeyemi to score with a low cross-shot.
Birmingham should have added to their lead two minutes later when Andre Blackman brought down Burke to concede a penalty.
Novak took the spot-kick only to see Cole dive to his right to make a superb save. Cole later thwarted Novak again with a reflex goalline save.
The misses proved expensive as Lewis Alessandra equalised with a goal out of the blue as he scored with a speculative 25-yard drive into the top left-hand corner of the net.
Allan was on hand to notch Birmingham's second in the 83rd minute with a first-time rocket to convert a cross from Shane Ferguson.
In the second minute of stoppage time Alessandra popped up again to notch his second goal.
But in the second minute of extra-time Bartley hooked home a low corner from Burke.
- Sports & Recreation
- Scott Allan
- Lewis Alessandra