The Blues had seemingly dropped two vital points when Bafetimbi Gomis deservedly equalised for the visitors in the last minute of normal time.
Until then, Wilfried Bony’s first-half header had separated the teams in a close-fought game which came to the boil in a frenetic -but satisfying conclusion.
Managerless Swansea arrived on the back of a long winless run that had ultimately cost Garry Monk his job.
While recent form suggested the Swans were struggling for confidence and their position is somewhat precarious, they have not become a bad team overnight - and they would prove as much in this encounter.
The Blues were given an early warning that the visitors weren’t at the Etihad to make up the numbers when Wayne Routledge wrestled his way clear into the box on five minutes only to be denied by a fine Joe Hart save.
And it was the Swans who had the next genuine scoring opportunity, too, as the dangerous Routledge again raced away down the right flank before picking out Gylfi Sigurdsson on the edge of the box and his shot was pushed over by Hart.
It was another reminder for the Blues that attack is the best form of defence, though the hosts had offered little of any real threat in the opening 20 minutes.
Slightly against the run of play, the breakthrough finally came on 26 minutes with Jesus Navas heavily involved. The Spanish winger worked a chance for himself in the box after a fine team move and was a shade unlucky to see his shot deflected over the bar.
From the resulting Navas corner Bony headed the ball home virtually unchallenged in the six-yard box to register his seventh goal of his stop-start campaign
Andre Ayew headed narrowly over from a free-kick minutes later as the Swans’ fluid formation continued to give the Blues defence problems, but there was to be no further scoring in the opening period with City just about doing enough by that stage.
Fabian Delph replaced Raheem Sterling at the break, but it was the visitors who again had the first chance after the re-start with an almighty goalmouth scramble that City were relieved to see ended by the assistant referee’s flag.
Then, after a Yaya Toure free-kick had stung the gloves of Lukasz Fabianski on 51 minutes, the Swans launched their own sortie that ended with Hart again forced to make a fine save from Sigurdsson from close range.
City needed a second goal to gain much-needed breathing space with the general feeling that one probably might not be enough to secure three points.
In fact, the longer the half went on, the more Swansea seemed to be gaining the upper-hand with the Blues forced to counter-attack after being hemmed in their own half for long periods.
Sigurdsson’s personal duel with Hart continued when the Icelandic midfielder fired in a wicked, curling free-kick on the hour that the City keeper did well to push away at the last second.
In a bid to freshen things up, David Silva was replaced by Kevin De Bruyne on 68 minutes with the hosts still just edging a much closer battle than the majority of the 53,052 crowd had perhaps expected.
The pattern continued in the latter stages with City having the occasional foray forward, but being pressed back for long periods by a side who surely won’t be near the foot of the table for much longer on the evidence of this performance.
Then, the late, late drama.
Swansea had been knocking on the door for long enough for Gomis’ 90th-minute equaliser to not be a huge surprise with the French forward out-pacing Eliaquim Mangala and firing a fierce shot past Hart to send the travelling fans wild.
With five minutes of added time still to play, there was still time for the Blues to dig themselves out of a hole - and they did exactly that.
Yaya Toure’s powerful curling shot struck Iheanacho’s back before looping over Fabianski and into the net deep into injury time to secure all three points and send the Etihad Stadium into raptures.
At this stage of the campaign, it is perhaps the result that matters more with City clearly running on fumes towards the end - and with the rare luxury of nine days until the next game, expect a more energetic performance at the Emirates Stadium for what should be quite a game...