Dutch striker Klaas-Jan Huntelaar also grabbed two goals, one a penalty, to lead Schalke 04 to a 3-1 win over Hoffenheim that took them up to second.
Forward Vedad Ibisevic levelled for Hoffenheim midway through the second half after Raul had given the hosts a 28th-minute lead with a controversial goal that led the referee to ask the Spaniard if he had used his hand.
Bayern, who entertain Napoli in the Champions League on Wednesday, netted three times in the first half as they bounced back in style from a surprise league defeat by Hannover 96 last week.
"The early goal helped a lot," coach Jupp Heynckes told reporters, referring to Gomez's second-minute opener.
"The team is playing excellent football, is confident with the ball and you can see they are enjoying the game. That is a crucial aspect of being successful."
Champions Borussia Dortmund dropped to third with 20 points from 11 games, five points behind Bayern, after drawing 1-1 at VfB Stuttgart.
Werder Bremen are fourth on 20 points after coming from a goal down to triumph 3-1 at Mainz 05, their first victory in four games.
Claudio Pizarro's 150th Bundesliga goal cancelled out Niko Bungert's 23rd-minute opener for Mainz before Aaron Hunt and Sebastian Proedl sealed the points for Werder.
Borussia Monchengladbach moved up to fifth, also on 20 points, after Marco Reus struck twice to earn a 2-1 victory over Hannover.
Hertha Berlin stunned VfL Wolfsburg 3-2, Pierre-Michel Lasogga notching the winner five minutes from time just seconds after the home team had levelled through Marcel Schaefer.
Heynckes brought back six players, including Gomez, who were rested for Bayern's 6-0 German Cup win over Ingolstadt in the week and his team made a dream start when the Germany forward headed them in front.
Gomez then set up Bastian Schweinsteiger to rifle in from 18 metres before Franck Ribery added the third goal in the 39th minute after a fine solo effort.
Striker Gomez added his 12th league goal of the season in the second half, tapping in a Toni Kroos pass.
On Friday, Michael Ballack's goal gave Bayer Leverkusen a 1-0 win over Freiburg but the former Germany captain also suffered a suspected broken nose that makes him doubtful for the Champions League game with Valencia in the week.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.