Referee Howard Webb had a torrid time, showing nine yellow cards, and had to deal with penalty claims, high tackles, flare-ups, baying Bayern fans, theatrics and continual protesting over his decisions.
The only surprise was that nobody was sent off, not even Real substitute Marcelo who produced a scything tackle on Thomas Mueller in stoppage time.
There was also pulsating football amid the chaos as Franck Ribery fired Bayern ahead in the 17th minute and Mesut Ozil levelled with a soft equaliser early in the second half.
Gomez then snatched the winner, his 12th goal of the Champions League and 40th of the season, shortly after having a penalty appeal turned down, to hand Real their first defeat of the Champions League campaign.
"I want to give a great compliment to my team my players, that they played so well and ran so much and played so well," said Bayern coach Jupp Heyckes, who led Real to their sixth European Cup title in 1998.
The Bavarians, whose season hinges on them reaching the final in their own Allianz Arena, managed to keep Cristiano Ronaldo under wraps for most of the game, although he laid on Real's goal.
"A draw would have been a fairer result but this is football, whoever scores wins and the game ends when it ends," said unflustered Real coach Jose Mourinho.
"It's not a terrible result. It's not as if we need an historic comeback with crazy numbers in the second leg, we need a normal result, 1-0 or 2-0, which we are capable of getting with our supporters behind us."
The two swaggering clubs, paired for the tenth time in Europe's top competition, have been European champions 13 times between them and previous meetings have been filled with unsavoury incidents.
This meeting did not plunge those depths but, with Real having made an art form out of gamesmanship under Mourinho's leadership, there was always likely to be trouble.
The first trouble came when Fabio Coentrao clipped Arjen Robben and 10 players immediately surrounded the referee to remonstrate.
Ribery was jostled by Real players after going down in the penalty area, Robben took a kick at Ronaldo after the ball and the Dutchman was then booked for a high kick on Coentrao.
There were numerous other incidents and Real picked up a series of yellow cards in the second half for late challenges, often producing theatrical reactions from their opponents.
Bayern took the lead when Ribery fired home from near the penalty spot after the La Liga leaders failed to clear a corner, Mourinho later claiming that a Real player was offside.
Source : Afghan Voice Agency (AVA), International Service