Birmingham 2 Manchester City 1
Steve Bruce's side had looked set to slump to a fourth successive home defeat as they went into the final 10 minutes trailing to Robbie Fowler's early strike, having laid siege to the visitors' goal without reward.
But Jeff Kenna equalised on 81 minutes when a Robbie Savage free-kick struck a post and rebounded straight onto his forehead and into the empty net.
Then, with just three minutes remaining, Richard Dunne's volleyed clearance hit Mikael Forssell and deflected past a stranded David Seaman.
Manchester City had looked more likely to end their poor run of form, which now extends to 10 matches without a win, after scoring with their first attack on 14 minutes.
Shaun Wright-Phillips crossed from the right and Fowler scored with a diving header at the far post - a brief glimpse of his former life as a much-feared striker.
Birmingham went on to dominate possession but were frustrated in their efforts to find an equaliser by a combination of poor finishing and good refereeing from Uriah Rennie, who twice turned down penalty appeals from the home side.
Forssell claimed penalties after tackles from Sun Jihai and Sylvain Distin, but despite vociferous appeals from the home crowd Rennie refused to point to the spot.
Forssell backheeled against a post as the home side began the second half in the ascendancy and Matthew Upson headed over and wide from David Dunn crosses.
Kevin Keegan's men could have extended their lead - and wrapped up victory - when they counter-attacked late on, but Nicolas Anelka and Trevor Sinclair were kept at bay by Maik Taylor and Claudio Reyna's shot hit the side-netting.
They were made to pay a heavy price for missing those chances, as Birmingham struck decisively late on, and they are now two months without a win.
For Birmingham, a second consecutive win banishes the memories of a miserable November and keeps them in eighth place in the Premiership.