Gomez’s 12th goal of this year’s competition boosted Bayern’s hopes of becoming the first team to play the Champions League final at its own stadium, and earn its fifth title.
Franck Ribery opened the scoring in the 17th minute for Bayern Munich. Mesut Ozil tied it in the 53rd.
The second leg is next week in Madrid.
The other semifinal begins Wednesday, with Barcelona playing at Chelsea.
Real took its first defeat in the Champions League this season, but the away goal could be decisive for the nine-time champions.
Gomez knocked the ball in after Philipp Lahmbroke through on the right and sent in a low cross. Gomez powered through to extend his right leg and push the ball home from close range.
Ribery put in a shot from inside the penalty area after Real had failed to clear a corner kick by Toni Kroos, with Sergio Ramos practically chesting the ball down for the Frenchman to score the first goal.
The equalizer came with Bayern’s defense looking uncharacteristically in disarray. Goalkeeper Manuel Neuer stopped Cristiano Ronaldo‘s effort, but could not hold the ball.
Real regained possession, with Ozil passing to Karim Benzema, who found Ronaldo again. The Real star passed across the goal for Ozil to score from 2 yards.
READING, England — Reading secured promotion to the Premier League after a four-year absence with two games to spare in the second tier.
The League Championship leaders ensured they would finish in the top two by beating Nottingham Forest 1-0 on Tuesday as third-place West Ham was held to a 1-1 draw at Bristol City.
Southampton is poised to join Reading in the Premier League, with the second-place side going five points clear of West Ham by beating Peterborough 3-1.
Promotion seals a remarkable turnaround for Reading, which was second to last in the standings four games into the season and was 11 points off the top in January. But Reading has 46 points from a possible 51 since then to secure its return to the EPL.