Two goals in the last 12 minutes saw Nancy claim their second successive in a week as victory over Rennes saw them move off the foot of Ligue 1.
Thomas Ayasse put the league's bottom side ahead 12 minutes from time with a stunning volley before Djamel Bakar secured all three points with a minute remaining.
The result sees Nancy move off the bottom and just two points from safety with their third win in four games, a run of form which has come at the most opportune time.
For Rennes, it extended their winless run to six league games and it appears their attention has turned to next month's Coupe de la Ligue final against St Etienne.
The hosts had the first chance of the game, Jean de Makoun turning and shooting straight at goalkeeper Damien Gregorini after being released by Jonathan Pitroipa.
Nancy then found themselves in a good position following a counter-attack but Benjamin Moukandjo shot straight at keeper Benoit Costil when well placed.
Pitroipa forced Gregorini to punch clear with a right-footed volley but it was Nancy who almost took the lead six minutes before the break.
Thomas Mangani's free-kick found Paul Alo'o Efoulou, who directed his header towards goal only for Costil to make a reflex save.
There were few clear-cut chances in the second half, Jean Kana-Biyik shooting just wide after pouncing on a ricochet from Julien Feret's free-kick.
However, in the 78th minute Nancy went ahead. Salif Sane delivered a superb ball for Ayasse, who unleashed a stunning right-footed volley to send the ball between the post and the keeper.
Then with just a minute remaining Nancy sealed all three points.
Alo'o Efoulou released Bakar near the penalty area and he worked his way in to unleash a fierce right-footed shot to leave Costil helpless as Nancy gave themselves further hope of escaping the drop.