The promoted German side left it late to earn their first victory of the new campaign and edge closer to a place in the top half of the Bundesliga table
In what was a very balanced first-half, the home side had the first opening 20 minutes into the game, when Raffael was played through by Patrick Ebert. But the Brazilian, with just the keeper to beat, tripped on the ball, and the chance was lost.
Just 10 minutes later, Stuttgart came close to scoring following a free-kick into the area, but Shinji Okazaki's header hit the bar and rebounded to safety.
The visitors were more lively in the second half, but as a result left spaces in their back line, and Hertha almost scored in the 68th minute. Adrian Ramos responded well to a free-kick from the right, forcing goalkeeper Sven Ulreich to tip the ball over the bar.
The winning goal came three minutes from full time through Raffael, who headed home after Ramos' shot had been denied by Ulreich.
With this victory, Hertha Berlin have moved up to 10th in Bundesliga, on five points, while Stuttgart sit one place below, with a point less.