The home side handed league debuts to summer signings Shinji Okazaki, Park Joo-Hoo and Sebastian Polter, while Daniel Schwaab and Moritz Leitner made their first competitive appearances for Stuttgart.
Nicolai Muller scored Mainz's first goal of the season just fifteen minutes into the game. The midfielder seized possession when Gotoku Sakai slipped on the ball and then ran past Benedikt Rocker - who also lost his footing - before slotting the ball home.
However, the away side replied just 90 seconds later through Vedad Ibisevic's instinctive finish.
Okazaki opened his Mainz account against his old side in the 69th minute to give the home side the lead once again.
Muller's second goal of the game with less than ten minutes remaining looked to have given Mainz a comfortable end to the game, but Martin Harnik scored a late goal for the away side to fray to nerves of the home fans inside the Coface Arena.
Stuttgart appealed strongly for injury-time penalty kick as Nikolče Noveski looked to clamber over Ibisevic, but the referee waved away the protests, much to the relief of the Mainz boss Thomas Tuchel.