Substitute Kevin Anin grabbed a dramatic stoppage-time winner as Nice boosted their European hopes this evening by edging a seven-goal Ligue 1 thriller at Toulouse.
The game was finely poised at 2-2 at the interval, Eric Bautheac starting and finishing the first-half scoring with Wissam Ben Yedder and Etienne Capoue on target for the hosts in between.
Dario Cvitanich's strike midway through the second half restored the visitors' lead, but Ben Yedder's second of the game got Nice back level only for Anin to edge TFC ahead again at the death.
As if the goal action was not enough to keep the crowd on the edges of their seats, there were also late red cards for Toulouse goalkeeper Ali Ahamada and Nice substitute Alexy Bosetti to add further spice to the occasion.
The result lifted Claude Puel's Nice to fourth spot and left Alain Casanova's Toulouse 11th in the standings.
Nice headed into the match on a run of three defeats in four games, but enjoyed the perfect start with a goal inside the first minute.
Jeremy Pied found space down the right and his delivery was missed by Toulouse goalkeeper Ahamada, leaving Bautheac with a simple finish for his sixth Ligue 1 goal.
However, the home team responded well and cancelled out the visitors' early opener within seven minutes. A goalkeeping error gifted Ben Yedder with an opportunity and the French midfielder finished confidently with the aid of the left post.
Now with the momentum, Toulouse did not stop there and shortly before the 20-minute found themselves in front. Ben Yedder picked out Capoue, who cleverly lifted the ball over David Ospina for his third goal in two matches.
Nice managed to haul themselves back level shortly before the break, though, Bautheac scoring his second of the game with a delightful free-kick which beat the wall and found the top corner.
Toulouse emerged for the second half looking to retake the lead and almost did so, but Capoue headed Etienne Didot's cross over from 12 yards.
Didot continued to cause problems and his cross was controlled and turned goalwards by Franck Tabanou, but Ospina was on hand to keep the scores level.
Ospina's efforts were rewarded in the 68th minute when Nice regained the lead. Mahamane Traore picked out Dario Cvitanich, who held off the challenge of Pavel Ninkov to round off a fine counter-attack from the visitors.
With eight minutes left, any chance of a comeback for Toulouse appeared to diminish when Ahamada was shown a straight red for hauling down Traore outside the area.
However, TFC thought they had claimed an unlikely draw when Ben Yedder snatched a 90th-minute equaliser but, to their disappointment, there was still time for a Nice winner.
Jonathan Zebina won an aerial duel with Bautheac to nod the ball into the path of Anin, and he finished coolly to break Toulouse's hearts.
To top of a frantic finale to the game, Bosetti was sent off for a dangerous lunge on Cheikh M'Bengue but his team held on for a hard-fought three points.