In a breath-taking final 15 minutes, the lead changed hands three times.
After Stuttgart scored three goals without reply to take the lead, Dortmund went back ahead in the 87th minute when Croatia midfielder Ivan Perisic scored, less than three minutes after coming off the bench.
But Stuttgart's Gentner broke Dortmund hearts with his team's fourth goal deep into added time.
Despite the frenzied finish, defending champions Dortmund still extended their unbeaten run to 22 games.
Second-placed Bayern Munich can halve Dortmund's six-point lead when they play Nuremberg on Saturday with the two teams on a collision course to meet at Dortmund's Signal Iduna Park on April 11 in the match which could well decide the league.
There was no sign of the drama to come when Dortmund's Japanese star Shinji Kagawa gave his side the lead with his fourth goal in three league games with an opportunist strike on 33 minutes.
Poland captain Jakub Blaszczykowski extended Dortmund's lead when he converted a long-range pass from defender Mats Hummels on 49 minutes.
The game burst into life when Stuttgart hit back with three goals in eight minutes.
Bosnia striker Vedad Ibisevic gave the guests hope with his strike in the 71st minute.
Stuttgart's Julian Schieber then turned the game on its head when he beat Dortmund goalkeeper Roman Weidenfeller on 77 minutes and then produced a superb individual goal 99 seconds later as Stuttgart went ahead.
Dortmund got back on level terms when defender Mats Hummels beat Stuttgart goalkeeper Sven Ulreich at the near post on 82 minutes.
Perisic then put Dortmund ahead five minutes later before Gentner's dramatic strike shared the points.
(For more sports news and updates, follow Ahram Online Sports on Twitter: @AO Sports)