It had looked like being a familiar story of frustration and Joe Hart brilliance in Germany for City as Lars Stindl finally beat the visitors’ outstanding goalkeeper to give the hosts a 54th-minute lead at a raucous Borussia Park.
But Nicolas Otamendi rammed home an equaliser 11 minutes later and City were rewarded for a bright finish as the otherwise laboured Aguero scored from the spot after being fouled.
City had conceded a penalty themselves in the first half but Hart saved from Raffael, as he did on a number of other occasions from the Brazilian and his team-mates in open play.
But the visitors also had a number of opportunities in a compelling Group D encounter played in a lively atmosphere befitting Monchengladbach’s first home match in the competition for 37 years.
Manchester City manager Manuel Pellegrini said: “It was a strange game! For 65 minutes both teams had very good chances to score, we did not defend well. In the last half hour we improved a lot and won the game.
“We knew that Bprussia have a very fast team. Joe Hart made some brilliant saves. It could have been 4-4 after an hour but then we dominated the game.
“We got a little bit of luck at the end but we have had plenty of bad luck recently.”
The first half was played at a ferocious pace with City looking to attack at every opportunity but being regularly caught on the break by an equally positive-minded home side.
Raffael was a constant danger and gave City a warning as he blazed an early chance over.
Another feature of the game was Aguero’s frustration in front of goal and the Argentinian was denied in the opening minutes by goalkeeper Yann Sommer as he slid onto a Raheem Sterling pass.
City had another chance as Kevin de Bruyne drove across goal but Patrick Herrmann narrowly missed the target for the hosts.
Monchengladbach had a great chance to go ahead as Otamendi’s clumsy challenge on Raffael resulted in a penalty but Hart saved the Brazilian’s spot-kick.
City quickly countered and Aguero raced through on goal but he dragged his shot wide and missed another opportunity soon after.
Monchengladbach began the second half at the same tempo and Hart was needed again as Raffael broke through once more.
With Granit Xhaka having a shot blocked it began to seem a goal was inevitable as City were being pushed back. It came as Julian Korb found room on the right and pulled the ball back for Stindl to fire a low shot past Hart.
It seemed City were again suffering on the continent and David Silva was withdrawn just after the hour. Yaya Toure had already left the fray at half-time.
But City found a lifeline from a corner in the 65th minute. Martin Demichelis fired the ball goalwards from a Fernandinho header and his effort was blocked on — or perhaps just behind — the line. City appealed to the referee for a goal but Otamendi did not wait for an explanation as he smashed home the rebound from outside the area via a big deflection.
City cranked up the pressure and Fernandinho went close and De Bruyne shot over. Substitute Jesus Navas delivered a dangerous cross and Sterling headed over.
The final word came in the last minute after Aguero was hacked down. The striker put a night of frustration behind him to net a cool winner.
Sommer, Korb (Traore 78), Christensen, Dominguez, Wendt, Herrmann (Hahn 72), Dahoud (Nordtveit 84), Xhaka, Johnson, Raffael, Stindl.
Hart, Sagna, Demichelis, Otamendi, Kolarov, Toure (Fernando 46), Fernandinho, De Bruyne, Silva (Jesus Navas 64), Sterling (Zabaleta 90), Aguero.
Clement Turpin (France).