A goal in either half from Artjoms Rudnevs was enough to earn the northerners victory over the struggling southerners, who remain inside the bottom three following the change in coach after Markus Babbel's dismissal during the week.
Hamburg now lie sixth and are on course for a place in Europe next season after spending much of the first few weeks of the season alongside Hoffenheim in the lower regions of the league.
The change in coach appeared to have provided a spark to Hoffenheim, who started brightly at the HSV-Arena.
However, after missing a few chances, most notably through Eren Derdiyok, their confidence levels soon dropped back to how they had been in recent weeks.
Hamburg took advantage and took the lead in the 27th minute when Dennis Diekmeier's cross from the right was headed in from eight yards by Rudneves with Koen Casteels not making a particularly convincing effort to keep the ball out.
Tolgay Arslan went close to making it two 10 minutes later, but his powerful effort struck the crossbar.
An expected reaction from Hoffenheim failed to materialise after the interval and Hamburg once again capitalised on their insecurity with Rudnevs making it two in the 74th minute.
The Latvian scored from a similar position to his first goal, albeit with his foot this time after Sebastian Rudy's poor headed clearance presented him with the chance.
Rudnevs later missed the chance to complete his hat-trick as he got the ball caught up between his feet as he looked for room to shoot, but he had done enough damage already to take Hamburg into the top six.