Despite their recent struggles, the hosts showed real firepower before the break, with the sides scoring twice apiece during a chaotic first-half at the Voith-Arena.
Stuttgart carried a threat from the off, with Chris Fuhrich seizing his chance to charge through a gaping hole in Heidenheim’s defence before calmly slotting past Diant Ramaj after just five minutes.
However, the home side rallied, and after Christian Conteh’s cross deflected kindly to Eren Dinkçi shortly before the midway point of the half, the Freiburg loanee confidently steered home for his first goal since rejoining the hosts temporarily last month.
In response, Stuttgart’s Ermedin Demirovic finished well from close range, but his goal was eventually ruled out - instead, a lengthy VAR review led to a penalty at the other end following Maximilian Mittelstadt's foul on Dinkci to start the attack.
From the subsequent spot-kick, Arijon Ibrahimovic made no mistake to complete the turnaround.
Stung into action, Stuttgart dragged themselves back into the game and earned a penalty themselves when C. Conteh felled Chema Andres inside the Heidenheim box.
Atoning for his earlier error, Mittelstadt stepped up and found the bottom corner to set up an enticing second period.
The high tempo continued after the restart, but with fewer chances created, although Alexander Nubel did need to produce a diving stop to thwart Ibrahimovic in the 50th minute.
As this rollercoaster of a clash entered its final stages, Demirovic looked to have snatched all three points with a little over 15 minutes remaining, but he was again denied by a VAR intervention given he was offside when nodding home Angelo Stiller’s floated free-kick.
Just as it looked as though the spoils would be shared, Heidenheim got their noses in front once more. After winning the ball back in the middle, Ibrahimovic drove forward with the ball as part of a three-on-one move.
Although Nubel was able to save his attempt, substitute Sirlord Conteh poked in at the back post to send the home crowd into raptures.

There was another twist to this tale, though, and a replacement was once again at the centre of the action.
Undav was already his side’s top Bundesliga goalscorer of the term with 12 goals, and he added a 13th with a fierce drive into the bottom corner.
A battling draw gives Heidenheim hope of avoiding relegation as they move to within six points of safety. However, Stuttgart’s UCL hopes took a hit, with them unable to take advantage of fellow top-four contenders RB Leipzig’s draw with Borussia Dortmund on Saturday.

Flashscore Man of the Match: Chris Fuhrich (Stuttgart)
