Wolfsburg went ahead 2-0 through goals by Patrick Helmes in the 28th minute and Marco Russ in the 60th minute. But when Cacau pulled a goal back in the 73rd minute it sparked a stunning turnaround as Maza equalised in the 77th minute before Ibrahima Traore's winner.
Even so, the win was not enough to realise Stuttgart's dream of nicking an automatic place in the Europa League as they finished sixth to go into the qualifiers.
The result left Wolfsburg out of European competition next season.
Stuttgart nearly took the lead in the 13th minute as Martin Harnik played the ball over the on-rushing Wolfsburg goalkeeper Diego Benaglip towards the box but Tamas Hajnal could not find the finish from close range.
Wolfsburg went close after 24 minutes but Stuttgart keeper Sven Ulreich made a fine stop when one-on-one with Mario Mandzukic.
The visitors pulled ahead in the 28th minute with Mandzukic crossing from the right side to Helmes, who hit home with his left foot for his 10th goal in the last 10 matches.
Helmes set up Wolfsburg's second goal on the hour mark, crossing from the left side to Russ, who struck in from five yards.
Stuttgart pulled a goal back in the 73rd minute with Cacau heading in a free kick by Matthieu Delpierre, and they were level four minutes later when Gotoku Sakai's cross found Maza and his volley bounced through the Wolfsburg defence to make it 2-2.
And the comeback was complete in the 79th minute with Sakai crossing from the right side into the box where Vedad Ibisevic failed to connect but Traore was waiting behind him to slot through the goalkeeper's legs.
Stuttgart nearly made it 4-2 in the 83rd minute but Alexander Madlung cleared Ibisevic's shot off the line.