Cristiano Ronaldo has scored 28 goals in all competitions for Real Madrid so far this season.
Real took control after Martinez's dismissal and could have extended its lead when captain Sergio Ramos headed into the net in stoppage time, only for the effort to be ruled out for offside.
Bayern goalkeeper Manuel Neuer was key to keeping Wednesday's game close as the hosts played the final 30 minutes with 10 men following the sending off of Javi Martinez with consecutive yellow cards.
That being said, the tension told when Marco Asensio, on as a substitute for Gareth Bale, clipped a delightful ball into Ronaldo's path on the 77th minute, and the forward got to the ball first to clip in the victor.
Nearly immediately after the restart, Ronaldo volleyed home Daniel Carvajal's cross on 47 minutes to level the score on the night and bring his tally up to 99.
"We have a small advantage and I hope the fans will be with us because it's going to be a hard battle".
The pivotal moment of the game was Arturo Vidal's missed penalty according to Ronaldo.
The coach was scathing of his side's display at the Juventus Stadium, calling their first half "a shipwreck". The pair of strikes made Ronaldo the first player ever to score 100 goals in European competition.
Ronaldo was presented with a commemorative shirt by club president Florentino Perez after setting the latest record in his illustrious career.
Real Madrid's Cristiano Ronaldo, front, celebrates after scoring his side's 2nd goal during the Champions League quarterfinal first leg soccer match between FC Bayern Munich and Real Madrid, in Munich, Germany, Wednesday, April 12, 2017.
Of those goals, 84 were scored with Real Madrid, with the other 16 scored while he was with Manchester United.
"Bayern have won only three of their 11 European matches at the Bernabeu - the last of which was on penalties in 2011/12 after it finished 3-3 on aggregate. At 1-0 down, we had good chances, but we came back well, we scored early [in the second half]", Ronaldo told reporters. The next leg will be played next week.
Bayern forward Thomas Muller admitted the Germans were pleased in the end to only come away with a 2-1 loss, saying on the club's website: "At the end we are happy that he remained 2-1".