Two goals from Sven Schipplock and a Kevin Volland strike put Markus Gisdol's men on the road to victory before Antonio Rudiger pulled a goal back for the visitors.
Roberto Firmino then sealed victory for Hoffenheim, who condemned Stuttgart to their fifth defeat in five games in 2014, leaving them hovering just above the relegation zone and without Moritz Leitner next weekend after he was sent off.
Both sides were desperate for the points to stave off the threat of relegation while neither were clearly interested in taking just a point.
That made for an open encounter with chances at both ends, and the first goal came in the 12th minute.
Firmino, who scored twice in the midweek DFB-Pokal defeat to Wolfsburg, sent the ball in from the left and although Volland could not reach it, Schipplock could from six yards out, drilling the ball into the roof of the net.
The game continued to swing from end to end, albeit with Hoffenheim looking far more dangerous when in possession, like when Sejad Salihovic struck the post from 20 yards out in the 41st minute.
Four minutes into the second half, the hosts doubled their advantage with Firmino again involved in the build-up, playing the ball to Salihovic who timed his cross to perfection to set up Volland, who beat Sven Ulreich from just inside the penalty area.
There was a spate of yellow cards as tempers flared in this local derby, mainly due to Stuttgart's players becoming increasingly frustrated as they were forced to chase the game.
The hill they had to climb became a mountain in the 66th minute when Schipplock made it three for Hoffenheim. He spotted Ulreich off his line and lobbed the ball over him from outside the penalty area, effectively sealing Hoffenheim's victory.
A header from Rudiger saw Hoffenheim concede their obligatory goal in the 78th minute, but there were never any signs of a comeback for Stuttgart, who lost Leitner to a second yellow card 10 minutes from time.
There was time for Hoffenheim's man of the match Firmino to crown his own performance with a penalty in stoppage time after Anthony Modeste was fouled inside the area.