Real came back twice through Marcelo and Karim Benzema to level the game after substitutes Edin Dzeko and Alexsandar Kolarov had put City ahead.
And then up stepped Ronaldo to give the home side a deserved three points to kick start their Champions League Group D campaign.
Real coach Jose Mourinho decided on a number of changes in the face of growing criticism in the Spanish capital after a disappointing start to his team's league season.
The Portuguese coach left out Sergio Ramos and Mesut Ozil from the side that lost 1-0 at Sevilla on Saturday, handing a debut to Michael Essien and a first game of the season to French youngster Raphael Varane.
There was also a surprise in City's line up with 19 year-old Matija Nastastic making his debut at centre-half after a summer move from Fiorentina, with both Maicon and Javi Garcia also starting after making their club debuts on Saturday.
Real took the initiative from the start as City took their time to adjust to their surroundings.
A blistering counter-attack by Real after eight minutes saw Gonzalo Higuain pick out Ronaldo who drew the first save of the evening from English international Joe Hart.
Four minutes later and Hart denied Higuain, this time with an acrobatic dive after the Argentine striker glanced a Ronaldo cross goalbound.
Next it was Alvaro Arbeloa cutting in from the left who tried his luck and it was all the home side.
Hart was then out quick to block Higuain and Sami Khedira shot over in the ensuing chaos as the Premier League side struggled to hold on.
On 32 minutes Hart got down well to save a Marcelo drive and the home crowd, strangely subdued at kick-off, for a fleeting moment smelt blood and upped the volume.
Yet the visitors gradually began to dispute more possession and but for a half chance for Higuain and an Angel Di Maria curled shot the interval arrived goalless.
City had yet to trouble the home defence and had also lost Sami Nasri who limped from the pitch on 35 minutes to be replaced by Kolarov.
A speculative shot from Yaya Toure earned City a corner on 53 minutes and the first action for their noisy travelling support to cheer, while Marcelo saw a thunderous drive go just at the other end.
On the hour the Spanish World Cup winner David Silva received a standing ovation from the home crowd on leaving the field as Mancini shuffled his pack and brought on Dzeko.
Mourinho immediately reacted bringing on Ozil to replace Essien and Marcelo saw another shot drift high.
It looked like the match would drift to a close with both teams happy with a point until Toure intercepted a short pass in his own half and made a wonderfully leggy sprint before playing in Dzeko who put City ahead.
The game burst into life and it was the English side who were enjoying the better chances. Dzeko and Toure went close as Luka Modric and Benzema were called from the bench for the hosts.
The changes had an immediate effect as Real levelled on 75 minutes when Marcelo, who had previously favoured his left, moved onto his right foot to curl a shot in from 25 yards.
City were now attacking at will and Kolarov took advantage to hit what looked like the winner on 84 minutes from a free-kick wide on the right that evaded Iker Casillas in the Madrid goal.
Their lead, however, was short lived during a crazy final five minutes.
It was another substitute in Benzema who turned well before shooting to level on 86 minutes.
And then Ronaldo, who had started the game on fire, finished it off with the last minute winner to break English hearts.
Source: AFP
Source: AFP