Following Tuesday's 3-2 UEFA Champions League defeat to Manchester City, the leaders continued their domestic dominance - making it 41 league games without defeat ahead of their FIFA Club World Cup participation, which begins next week.
It had looked set to be a frustrating afternoon for the champions but Mario Mandzukic ensured that the hosts went in ahead at half-time, as he edged Bayern in front after 42 minutes.
The striker held off the attentions of Jonathan Tah to head home his 10th league goal of the season and give his side the lead.
Mario Gotze put Pep Guardiola's men two goals up early in the second half, taking advantage of a poor clearance from the home defence. After Thomas Muller's cross was only half cleared, Thiago Alcantara played a neat ball into Gotze's feet before the Germany international controlled, swivelled and curled past Jaroslav Drobny.
While Pierre-Michel Lasogga pulled a goal back three minutes from time, Xherdan Shaqiri came off the bench to score Bayern's third in the final minute and secure victory.
Bayern coach Guardiola made three changes from the defeat to City, with Jerome Boateng, David Alaba and Franck Ribery all failing to make the starting XI.
The latter two were named on the bench, with Daniel van Buyten, Rafinha and Diego Contento handed starting berths.
There were also three changes made by Hamburg coach Bert van Marwijk, with one coming in goal as Drobny replaced Rene Adler following defeat to Augsburg last time out.
Jacques Zoua and Rafael van der Vaart also started at the expense of substitute Michael Mancienne and Maximilian Beister.
Drobny was called into action after nine minutes, diving low to his right to smother a long-range Toni Kroos strike, before Manuel Neuer pulled off a similar save to deny Hakan Calhanoglu.
Bayern then began to exert dominance, but they struggled to break down a stubborn visiting defence that had kept two clean sheets in their previous four Bundesliga games on the road.
Mandzukic went close to connecting with a cross from the right and then threatened again eight minutes before the break, heading wide from Kroos’ delivery after failing to make clean contact with the ball.
He was not to be denied however, latching on to an acrobatic Rafinha cross, following a delightful cross-field pass from Kroos, to direct the ball past Drobny three minutes before half-time.
The home side doubled their lead seven minutes after the interval, courtesy of Gotze's exquisite turn and finish in the area before Lasogga sidefooted home inside the area from Marcell Jansen's cutback after 87 minutes.
However, Shaqiri took full advantage of Johan Djourou's poor clearance in the 93rd minute to set the seal on the win, calmly slotting Pierre Emil Hojbjerg's throughball past Drobny to ensure an eighth straight league victory for Bayern.
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.