Alexandru Maxim, Christian Gentner and a Johan Djourou own goal accounted for Stuttgart's haul, while Pierre Michel Lasogga, Maximilian Beister and
Rafael van der Vaart were all on target for Bert van Marwijk's Hamburg, who continued their impressive goalscoring form having put five past Nurnberg on their last outing.
Stuttgart ended the game with 10 men after Antonio Rudiger was given his marching orders five minutes from time, but they held on to preserve Thomas Schneider's unbeaten record since taking charge.
Maxim has been developing a strong reputation as a provider of goals, but he turned finisher to put Stuttgart in front early on.
He exchanged passes with Vedad Ibisevic, who usually benefits from the Romanian's creativity, but this time watched as he chose to shoot into the far corner of Rene Adler's goal.
Hamburg then took charge of proceedings with Lasogga deservedly bringing them level midway through the first half.
William Kvist lost possession to Tolgay Arslan once, then he slipped as he tried to recover the ball, allowing Arslan to cross to Lasogga, who had an easy tap-in for his sixth goal in the last four games.
Stuttgart regained the lead in typical fashion, Maxim curling in a dangerous free-kick which needed just the slightest of flicks from Gentner to guide the ball into the far corner in the 37th minute.
Hamburg levelled again 10 minutes into the second half, giving rise to another dominant phase of pressure from the northern Germany side after Marcell Jansen's low cross from the left was slotted in by Beister.
Van der Vaart's free-kick was glanced just inches wide by Lasogga before the Dutchman had a header saved on the line, Lasogga's rebound being cleared by Martin Harnik.
A goal was in the air, yet it surprisingly arrived at the other end with Ibrahim Traore's low cross turned into his own goal by Djourou, under pressure from Ibisevic.
Their lead lasted just three minutes this time before Van der Vaart picked his spot in the far corner to bring Hamburg level for the third time in the game.
There was more drama to come with Rudiger sent off with five minutes left for lashing out at Van der Vaart off the ball, but the home side were unable to capitalise.