
Two goals from Paolo Guerrero and one each from Nigel de Jong and Mohamed Zidan gave Hamburg the points against an injury-hit Frankfurt side who last week beat second-placed Werder Bremen for their fourth win in five games.
Hamburg move third, switching places with Bayer Leverkusen who went down in Bochum to a goals in the 66th minute from Thomas Zdebel and two minutes from time from Stephan Dabrowski.
Bayern have 47 points, four more than Bremen, with Hamburg on 41, three ahead of Leverkusen, who entertain Hamburg on Thursday in a first-leg tie in the UEFA Cup last 16.
Hamburg, knocked out of the German Cup by Wolfsburg mid-week, were soon in front in driving rain against Frankfurt when Guerrero headed in a cross from Piotr Trochowski in the fifth minute.
Midfielder Nigel de Jong headed the second 12 minutes after the break from a free-kick by fellow Dutchman Rafael van der Vaart.
The home side were pegged back when Greek defender Sotirios Kyrgiakos rose to head in a free-kick from the left from Markus Weissenberger in the 70th minute.
The goal gave Frankfurt fresh hope and Hamburg were suddenly on the back foot, but Guerrero settled the home side's nerves nine minutes with his second of the match.
Van der Vaart tried a long range shot which keeper Oka Nikolov could only parry on the slippery surface and the Peru striker reacted quickly to turn the ball into the top of the net.
Five minutes later Zidan, who had come on as a substitute in the 74th minute, rifled in a low shot from the edge of the area past Nikolov's despairing dive to complete the scoring.
Hamburg coach Huub Stevens refused to be drawn into talk of a title challenge or Champions League qualification, saying the three points now meant his side could not be relegated.
"Third place is not so important to me. We played good, attacking football and took advantage of Frankfurt's many injuries," He said.
In Saturday's action, Miroslav Klose ended a seven-match goalless series in the Bundesliga by notching the only goal of the match for Bayern Munich at Schalke 04, while Bremen downed Borussia Dortmund 2-0 thanks to two goals from Markus Rosenberg.