Bayern enjoyed 80 percent possession in the first half but it was the nine-times European champions who scored when Karim Benzema completed a quick break in the 14th minute for the winner.
The Bavarians, hoping to become the first team to successfully defend the Champions League title, struggled to break down the solid Real defence.
When they did find a way through they were let down by sloppy finishing.
"What we were missing was the finish," said Bayern coach Pep Guardiola, who is looking for a treble of titles in his first season in charge.
"The result is certainly not ideal, but we can still improve in the second leg. We will analyse the game and then decide what our best options are for the return leg in order to successfully overcome this task.
"I am very optimistic. Even more than before this game."
However, former Bayern player and coach and honorary president Franz Beckenbauer was less impressed.
He told Sky television: "Possession doesn't mean anything when your opponents create the better chances. We are lucky they only scored one."
Guardiola did not see it that way, and insisted that keeping the ball was more important.
"I could not be prouder of my team, because we dominated the ball," the Spaniard added.
"I told my players that I wanted them to play with courage and bravery and with respect to the people who were watching us, and that's what we did.
"I know how difficult it is to play against Real Madrid, as a player and as a coach, and many players are scared when they come here, but we showed character."
The coach also defended his team's tactics, when asked if they should have played in a more direct manner.
"The faster the ball goes forward, the faster Madrid bring it back to us," he said.
"Madrid's virtue is that they are so quick on the counter-attack, they are unstoppable in that sense. Their players are footballers but they are like athletes, so playing back and forth is a risk."
Bayern winger Arjen Robben also insisted that the Bavarians had produced a strong performance.
He told German television station ZDF: "We head into the second leg with a lot of confidence. I think we played well, we were up against Real Madrid, a super team, and we dominated them.
"We created a couple of chances, Gotze's was excellent. Now we have to improve for the return match."
The sensational season Bayern have enjoyed so far suggests they are capable of turning the tie around at the Allianz Arena, where they will be backed by a vocal 60,000 crowd.
Their recent slump in form, however, has worried club officials and fans. After clinching the Bundesliga title in record time with seven games to spare they lost two of their next three league games, drawing the other.
"I don't think there ever was another Bayern team that dominated at the Bernabeu the way we did it," said Bayern sports director Matthias Sammer. "But the fact is we controlled possession, not the result.
"Now we have to make it happen in the second leg. We have to be ruthless in our finish."
Bayern wingers Franck Ribery and Arjen Robben struggled to make any inroads into the Real defence and despite enjoying 64 percent of overall possession the Germans had to wait until late in the game for their best chance with Mario Goetze's close-range shot blocked by Real's Iker Casillas.
"We were missing that little bit of luck and that decisive attacking action," said captain Philipp Lahm.
"We would have liked a different result but we have every chance to score two or three goals at home. I am positive about the return leg. We have often shown we can turn ties around."
- Sports & Recreation
- Real Madrid