Now only a mathematical chance remains of Joachim Löw's side failing to qualify for next year's finals, to be hosted by the Ukraine and Poland, as they picked up their seventh straight win in Group A.
"I must pay the team a big compliment, I think we have put in a great season," said Löw, who enjoyed his 47th win from 68 international matches as coach. "After all, it is 24 days since the end of the German league season and the players are at their limits. Azerbaijan defended well, so ultimately, I'm very satisfied."
Despite coming to Baku, near the Caspian Sea, with a depleted squad, the Germans still had enough young talent to comfortably see off Azerbaijan and at 27-years-old, captain Philipp Lahm was the oldest German on the pitch.
"Hard to believe that at 27, I was the oldest out there, but it shows the depth of young talent we have in the squad," said Lahm, who was winning his 80th cap.
Real Madrid star Özil opened the scoring with half an hour gone at the Tofik Bakhramov Stadium when he latched onto a loose ball in the penalty area and curled his shot around diving goalkeeper Kamran Agayev.
The winger then turned provider for the second goal when he found plenty of space down the left flank and crossed the ball in for Gomez to drill his shot into the back of the net on 41 minutes.
It was Gomez's fourth goal in his last three games for Germany as the Bayern Munich star's purple patch continues having netted 28 goals last season in the Bundesliga.
The hosts scored a consolation goal with time almost up when striker Murad Huseynov stabbed home his shot in the 89th minute after capitalising on a mistake by Germany defender Mats Hummels, who failed to get his header away.
But replacement Andre Schürrle netted Germany's third deep in added time after fellow sub Mario Götze split the defence and after Gomez's shot was saved, Schuerrle followed up.
The Germans can wrap up qualification if they beat Austria in Gelsenkirchen on September 2.
The defeat leaves Azerbaijan's German coach Berti Vogts in a precarious position as his side are joint bottom of the table and he was pelted with loo paper at a news conference in Baku on Sunday by angry journalists.
The journalists – some of whom also gave Vogts a pitcher used for post-loo washing in the mainly Muslim country – demanded his resignation after the team's defeat to Kazakhstan on Friday.
Despite the insults, Vogts - who guided Germany to the Euro '96 title –said he did not intend to quit, although local media reported that he intended to press charges against the perpetrators and he had bodyguards during training this week.
"We wanted a good result, the fans naturally wanted a victory," said Vogts. "But Germany are in a different league compared to Azerbaijan. For the players, it was an experience that shows them what we have to do … work very hard, which we will do."