The England goalkeeper was finally beaten late on having kept out Pep Guardiola's side for the majority of the 90 minutes as City suffered defeat in their group stage opener
City goalkeeper Joe Hart frustrated the Bundesliga champions for long periods of the Group E opener at the Allianz Arena on Wednesday, as Bayern looked set to start the group stages with a draw.
Thomas Muller ought to have put the Bavarian giants in front inside a minute when he rounded Hart but could only fire wide when he finally got his shot away.
Manuel Pellegrini could only watch on from the stands as he served a touchline ban, with his assistant Ruben Cousillas taking charge on the sidelines, and he must have had his head in his hands as former City defender Boateng's half-volley deflected past Hart at the death.
|By Keeghann Sinanan
"Bayern edge out the victory that they probably deserved in the end, though they have the most unlikely source to thank for the three points. Jerome Boateng's late wondergoal, his first ever in the Champions League, did the damage. City, defending on the edge for so long, were finally beaten and in truth, did not threaten enough in the final third. Not the start that Manuel Pellegrini would have wanted."
Mehdi Benatia was handed his Bayern debut, while fellow defender Rafinha made his first appearance of the season after recovering from an ankle injury.
Arjen Robben was only deemed fit enough to start on the bench after recovering from a knee problem.
Edin Dzeko, Yaya Toure, and Samir Nasri all returned to the City starting line-up as Sergio Aguero, Frank Lampard and James Milner dropped to the bench, while Bacary Sagna replaced the suspended Pablo Zabaleta.
Guardiola stressed the importance of Bayern starting their European campaign with a win to set the tone for the group and they should have been in front with less than a minute gone.
City were given a let-off when Mario Gotze burst forward and laid the ball off to Robert Lewandowski, whose deft flick put Muller through but the Germany forward could only shoot into the side-netting with the goal gaping after skipping around Hart.
The visitors failed to heed the warning and were indebted to a fine reflex save from Hart to keep out Muller's powerful header after he rose to meet Juan Bernat's inviting cross, before the City keeper got down well to palm away Gotze's deflected strike.
The game was being played at a frantic pace and Dzeko almost put City in front 22 minutes in with a left-foot effort which flashed just past the far post following a swift counter-attack.
City were struggling to cope with Bayern's passing and movement , and the busy Hart denied David Alaba before Lewandowski fired just wide from a tight angle after rounding the keeper.
Normal service was resumed at the start of the second half, as Hart was alert to the danger once again to comfortably keep out Gotze's shot from inside the penalty area.
Bayern remained on the front foot as Hart flapped at a cross from the right before scrambling back to tip Bernat's effort over the crossbar, then David Silva had a chance to put the visitors in front against the run of play when he raced into the box and headed Jesus Navas's cross wide.
Hart then spilled Rafinha's shot, and reacted well to deny Muller following up but the linesman's flag was up as City lived dangerously once again.
Robben was introduced late on and was in the thick of the action when he went down in the penalty area, but the referee rightly waved play on as Bayern's frustrations mounted.
And City had a penalty shout of their own when Navas claimed he was caught by Benatia, but the referee again ignored the protests as the game appeared destined to end goalless.
However, Boateng popped up as the match entered stoppage time, with his well struck right-foot effort deflecting off the back of Gotze and beyond a helpless Hart to hand the hosts the win.