The Ivorian latched on to Fernandinho’s backheel before powering past two defenders and slotting the ball past Lukasz Fabianski on 62 minutes.
City fell behind just nine minutes into the game when Nathan Dyer set up Wilfried Bony to beat Joe Hart from close range.
But the home side equalised before half-time when Stevan Jovetic turned in a Jesus Navas cross and Gael Clichy also hit the post from distance before the break.
Pressure has been on Manuel Pellegrini’s during a poor run of late in all competitions, and they had to dig deep to find a seventh Premier League win of the season.
The pressure was ramped up when Dyer flicked the ball over the back-four to release Bony, who controlled brilliantly on his chest and caressed home the opener.
But City responded like the champions and they should have been ahead at the break after Jovetic equalised, with Sergio Aguero also going close alongside Clichy’s long-range strike that hit the woodwork.
The home side dominated the second half and had numerous chances to put the game beyond the Swans – but it was left up to Toure to grab the winner.
Swansea almost had an equaliser in stoppage time when Jonjo Shelvey’s free-kick was deflected off the wall just millimetres past the far post.
“Man City started ok going forward but you could see there was a weakness defensively. It took ages for Yaya Toure to get going. His best stuff came when he moved higher up the pitch. They may have to make a change for Bayern Munich, get him in a different position and go with two holding midfield players.
“Bony got in ever so easy for the opener, right through the heart of the two centre-backs, and you do not see Zabaleta coming in and doing any covering. He’s been a superstar for City but for the past six months you don’t see him defend – and he’s a defender!
“They got back into it at 1-1 and they bossed the game after that. Then Toure, who pushed further forward, scored a beautiful goal. They deserved to win this but in the end they were hanging on and the fans weren’t happy. Navas had one assist for the equaliser but his final ball was awful. Why he keeps him in the team I don’t understand.”