After a goalless first half, substitute Olivier Giroud bundled home to give Arsene Wenger’s men the lead, before Ozil netted a second for the home side in stoppage time to revive their European hopes.
The win left Arsenal third in their group and three points behind both Bayern and Olympiacos.
And Ozil conceded that Arsenal had no choice but to secure victory on Tuesday night after losing both of their two opening group games.
Ozil told Arsenal Player: Firstly we’re very, very happy. To win against Bayern Munich is really hard and we knew that it would be a tough game but you could see during the match that we created a lot of opportunities, especially in the first half, when Manuel Neuer made some superb saves.
“But ultimately I think we deserved to win. They had more possession but we had the clearer chances and that’s why we’re really pleased to have got the three points today.
“We concentrated from the first minute until the last minute. We believed in ourselves and we knew that we had made massive mistakes in the first two games.
“Today was our last chance – we had to win. We did that and now we’re back in the game. We’re all the happier for that.
“We showed heart and the fans supported us superbly. The most important thing is the three points.
“We have to believe in ourselves, keep working hard and then we’ll be on a good path.”
Ozil and his Arsenal team-mates now turn their attentions back to the Premier League and preparing for Saturday evening’s clash with Everton at Emirates Stadium.
The Gunners can move top of the Premier League table with victory over the Toffees, before Manchester City travel to Manchester United on Sunday in the top flight.
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news