Cristiano Ronaldo's 90th-minute winner capped a memorable comeback by the Spanish champions, who trailed 2-1 with five minutes to play.
Madrid coach Jose Mourinho had launched a number of attacks against his players following a 1-0 loss at Sevilla on Saturday, questioning their work ethic and priorities, and calling on his squad to prove their mettle against the English champions.
They certainly responded to restore confidence that a record 10th European Cup is attainable this season.
"It's the first time my players go home tired after a game. In football, you should go home feeling tired after every game," Mourinho said. "That's what Real Madrid stands for and it's not a cheap philosophy. You have to be ready to die on the field."
Madrid's woeful finishing nearly cost it as it wasted a number of scoring chances before City's 69th-minute opener. But the team knew how to respond as it twice rallied before Ronaldo dipped a shot under goalkeeper Joe Hart in the 90th minute.
Ronaldo, who returned to the Santiago Bernabeu Stadium for the first time since saying he felt "sad" at the club, celebrated his goal this time around. But he did not suggest his mood had turned.
"How I am, that doesn't matter," the Portugal forward said. "I celebrate everything that needs celebrating. What happened in the past doesn't matter, the past is the past."
Mourinho insisted he would not point fingers over the Spanish champions' poor domestic league form, which has seen it slip eight points behind leader Barcelona after just four games. But his lineup certainly indicated that defender Sergio Ramos was one of the culprits.
The Spain defender has rarely missed a game since joining the club in 2005 and has reportedly shared heated discussions with his Portuguese coach before.
"It was absolutely a technical decision, nothing personal," Mourinho said. "I have never had any disciplinary problems with Sergio. Never. Zero. He's a great player, a great professional.
"I want to make this very clear."
Ramos congratulated his teammates with a message on Twitter.
Mourinho instead felt Raphael Varane was a better partner for Pepe as the 19-year-old Frenchman stepped in to play his first game of the season.
"I've been preparing since Sunday. The coach spoke to me and told me I had his confidence," Varane said. "It was a surprise because it's one of the most important games of the season."
Varane's entry did not stem Madrid's weakness on set pieces as City took the lead from a free kick.
But the real barometer of Madrid's turnaround will be measured in its next Spanish league match Sunday at Rayo Vallecano.
Follow Paul Logothetis on hhttp://twitter.com/PaulLogoAP