Ronaldinho holds Madrid in Milan
Striker Karim Benzema put the dominant Spanish side ahead on 29 minutes when he squeezed a close-range effort under Dida, who had first parried a shot from former Milan playmaker Kaka.
Milan, level at the top with Real on seven points from four games, equalised 10 minutes before the break through Ronaldinho's thumping penalty after Pepe slid in on Gianluca Zambrotta and was harshly adjudged to have handled.
Moments later the home side had the ball in the net again but Pato, who scored twice in Milan's 3-2 win at the Bernabeu last month, had his goal ruled out for another debateable handball as he brought down a high pass.
The Brazilian did not protest but an almost full San Siro roared with anger at the officials.
"These things happen. I always believe in the good intentions of the referee," Milan's Brazilian coach Leonardo told a news conference, partly in fluent Spanish.
"It seemed to me it was a normal goal while for the penalty you could say that it was right to give it.
"We are getting better, each game we improve a bit."
The visitors had much the better of the early exchanges, Benzema going close twice and strike partner Gonzalo Higuain scuffing one of several other good chances for Real.
When Milan finally imposed themselves on the game, Pato wasted a decent opportunity and midfielder Massimo Ambrosini headed over before Dida pulled off two fine late saves.
"We played a good first half with a good attitude, we had 16 shots," Real coach Manuel Pellegrini said, refusing to answer questions about the referee.
"We had a lot of control of the game but second half it was a bit more complicated. At the end there were a couple of chances to get the three points which we would have deserved."
Kaka, who joined Real from Milan in the close season, was given a warm welcome back with the crowd applauding him and several banners being unveiled thanking him for his six years with the Rossoneri.
The Brazilian, the inspiration behind Milan's last trophy when they won the 2007 Champions League, had another fairly quiet game and was often muscled off the ball by Ambrosini.
Real left out Raul, level with Gerd Mueller on a record 66 goals in the three main European club competitions while fellow European maestro Filippo Inzaghi also started on the bench for Milan.