Bastian Schweinsteiger headed in a deft Toni Kroos chip to give Bayern the lead in the 40th minute before early second half goals from Thomas Mueller and Kroos made sure the Bavarians bounced back in style from their first league defeat last week.
Bayern's ninth win in 10 league games lifted them to 27 points and opened up a huge gap as their rivals faltered.
"It was a good goal and more importantly a crucial one," said Mueller of his seventh goal of the season that helped Bayern clinch their first win in Hamburg in six years.
"Finally we won again here because it had been an issue for quite some time."
Bayern, hosting Lille in the Champions League on Wednesday, were eager to shrug off last week's defeat to Bayer Leverkusen and dispel any thoughts of a possible repeat of last season's mid-season implosion.
With Franck Ribery back in the starting lineup but Arjen Robben back on the bench after his German Cup appearance in midweek, Bayern took the lead just before the break.
Kroos looked to have missed his chance when he was sent clear with only Rene Adler to beat but he managed to recover, sending a clever chip over the keeper to the far post for Schweinsteiger to score with a diving header.
Hamburg, with three wins in their last four games, struggled to make an impact in Germany's traditional north-south derby.
It took only three minutes after the restart for Bayern to strike again with Mueller's audacious shot from the tightest of angles beating Adler.
Kroos took any wind left out of Hamburg's sails drilling in from close range in the 53rd minute as Bayern set a Bundesliga record for five wins in five straight away games since the start of the season, without conceding a goal.