Bayern were unbeaten this season and had won on their two previous visits to Emirates and were by far the better team, but Arsenal ran themselves into the ground in the hope they might get something from the match.
They were rewarded in spectacular fashion on a night they had to win after losing their opening two group ties.
And they ultimately did it in style after soaking up relentless pressure and chasing shadows for much of the match.
They also had a rare error from the previously impregnable Manuel Neuer to thank. The German No.1 had made two world class saves in the first half but blundered to allow substitute Giroud to head home in the 77th minute.
Then, with Bayern chasing the game Hector Bellerin crossed for Ozil to score against his fellow countryman in time added on at the end.
Giroud said: “We did well until we scored and defended really well as we knew Bayern would have the ball as they are always doing very well in possession. They finished with almost 70%. We knew that would happen but we were patient an finally we scored and then finished it with Mesut’s goal.
“We needed this win to stay in the Champions League and qualify for the next stage. We’ve done it and we worked together to get our success. We also have to thank our goalkeeper Petr Cech because he had a fantastic game against a fantastic team.”
Knowing Arsenal would be going all out to win, Bayern manager Pep Guardiola set his team up to take the sting out of Wenger’s men.
But bar an effort from Robert Lewandowski after only 20 seconds, a couple of mazy runs from the impressive Douglas Costa and a good Cech save from Thiago, Bayern had little to show for their domination of the ball at half-time.
And just maybe the visitors had fallen into wily old Arsene Wenger’s trap as his team was perfectly poised to attack on the break and were it not for two stunning saves, Arsenal would have been worthy leaders at the break.
The undisputed world’s best keeper made an excellent save low to his right from Ozil early on, but produced another stop that will be discussed for many years when he denied Theo Walcott.
Nacho Monreal floated a hopeful cross in from the left and Walcott, who had posed a regular threat with his pace on the counter-attack, connected to head to Neuer’s left.
The Arsenal fans behind the goal were already up in celebration before the 6’4” 29-year-old extended his left hand to palm the ball away. Could Walcott have done better? Possibly. Would he have scored against most other goalkeepers? Almost definitely.
Just like he did when manager at Barcelona, Guardiola sent his team out for the second half to continue trying to pass Arsenal to death.
The running and chasing was relentless for the Arsenal players and it certainly proved too much for midfielder Aaron Ramsey who pulled up with a hamstring injury. The Welsh international, who had hamstring problems last season, would now seem a serious doubt for Arsenal’s huge Premier League match against Everton this Saturday evening.
Arsenal might have looked tired, battered and bruised, but they were still very much in the game as the closing stages approached.
Sensing it was there for the taking and maybe a more physical presence was needed Walcott was taken off in favour of Giroud with 16 minutes left.
But it was Cech who emerged their key player next when he made a strong one-on-one save from Lewandowski, the Bayern Munich goal machine who had scored 22 goals in 16 games coming into the match.
Giroud though had the last laugh when he headed Arsenal in front with his first touch of the game. Santi Cazorla clipped a free-kick to the far post and Neuer got distracted by Laurent Koscielny’s jump and missed the ball completely to allow Giroud to score with a diving header into an empty net.
It was a classic old school Arsenal smash and grab as the home fans celebrated with a rousing chorus of their signature European anthem – ‘1-0 to the Arsenal.’ They had to change their tune when Ozil volleyed in from Bellerin’s late late cross, but they were past caring by then. Now they have to go and do it all again in Munich on November 4.
Cech 8; Bellerin 8, Mertesacker 7, Koscielny 7,Monreal 7; Coquelin 7, Cazorla 6; Ramsey 6 (Oxlade-Chamberlain 57, 6), Ozil 6, Sanchez 6 (Gibbs 82, 6); Walcott 7 (Giroud 74, 7).
Neuer 7; Lahm 6, Alaba 7, Boateng 6, Bernat 6; Vidal 6 (Rafinha 71, 6), Alonso 7 (Kimmich 71, 6); Muller 6, Thiago 7, Costa 8; Lewandowski 6.