Shinji Okazaki opened the scoring in the 48th minute and then Pavel Pogrebnyak converted from the spot after 77 minutes to give Stuttgart the spoils.
Stuttgart, who have never lost against Hoffenheim, collected their fifth victory in the last six games to jump to 16 points and leave them level with third-placed Borussia Dortmund. Hoffenheim remain on 13 points
The guests were lucky that a penalty was not given in the 20th minute as Isaac Vorsah appeared to have taken down Pogrebnyak.
Hoffenheim were close to opening the lead after 21 minutes but Ryan Babel's hammer from the right side was deflected for a corner by Stuttgart keeper Sven Ulreich.
But the first half did not have many more highlights or goal chances as the game became more and more physical.
Stuttgart however grabbed the lead in the 48th minute as Tamas Hajnal's quickly-taken free-kick went to a charging Okazaki, who played the ball wide and then chipped back a shot past Hoffenheim keeper Tom Starke and Vorsah.
Stuttgart decided the game in 13 minutes from time after Vorsah brought down Pogrebnyak on the left side of the area. The Russian international took the responsibility himself and struck his left foot inside the right post.