After a goalless first half, the English champions took a shock lead when Yaya Toure burst through the middle to play in Edin Dzeko, who slotted past Iker Casillas.
Real equalised through Marcelo’s excellent curling effort, but City regained the lead five minutes from time when Aleksandar Kolarov’s curling free-kick evaded everyone and snuck into the far corner.
Substitute Karim Benzema equalised with two minutes remaining, before Cristiano Ronaldo beat the excellent Joe Hart with a dipping effort in injury time.
In the other Group D fixture, Borussia Dortmund beat Ajax Amsterdam 1-0 courtesy of Robert Lewandowski winner three minutes from time at the Westfalenstadion.
In Group A, Paris Saint Germain started their Champions League campaign in convincing fashion, beating Dynamo Kiev 4-1 at the Parc des Princes.
The big-spending French outfit were three goals up inside 32 minutes courtesy of Zlatan Ibrahimovic, Thiago Silva and Alex. Miguel Veloso pulled one back, but Javier Pastore made sure of an easy three points.
Elsewhere, FC Porto made light work of Dinamo Zagreb, with Steven Defour scoring late on after Lucho Gonzalez had given the perennial Portuguese champions an early lead.
In Group B, Arsenal were made to sweat for a 2-1 victory over French champions Montpellier.
Younes Belhanda gave the hosts the lead on nine minutes after a clumsy challenge from Thomas Vermaelen, but two goals in as many minutes from Lukas Podolski and Gervinho ensured a winning start for Arsene Wenger.
In the group’s other match, Schalke were made to work for a 2-1 win over Greek side Olympiacos.
Benedikt Howedes and Klaas Jan-Huntelaar netted either side of a Djamel Abdoun strike to give the Germans a perfect start in Athens.
In Group C, AC Milan’s woes continued when they were held to a goalless draw at home by Belgian champions Anderlecht.
That means big-spending Spaniards Malaga go top the group after a 3-0 win over Zenit St Petersburg at La Rosaleda.
A brace from young Spanish international Isco and another from Javier Saviola was enough for the three points.