Second-half substitute Anthony Mounier scored twice to give Nice a 2-0 victory over Ligue 1 relegation rivals Valenciennes.
The winger broke the deadlock in the 68th minute and sealed the points in stoppage time as Nice moved to within a point of safety and their opponents dropped into the bottom three.
The win moved the hosts level on 17 points with Valenciennes.
Nice looked the more determined early on and almost went in front in the 12th minute when Nemanja Pejcinovic’s far-post header from Fabrice Abriel’s corner beat goalkeeper Nicolas Penneteau but was cleared off the line by Jose Saez.
Franck Dja Djedje then freed David Hellebuyck inside the area, but Penneteau pushed away his left-footed effort.
Francois Clerc fired narrowly over as Nice continued to threaten before the visitors finally worked home keeper David Ospina.
The keeper went down to save Foued Kadir’s effort from the edge of the area.
That was a rare foray forward for VA, though, as Nice’s dominance continued after the break.
Penneteau was equal to Kafoumba Coulibaly’s angled shot from long range three minutes after the break.
Nice coach Rene Marsiglia brought on Mounier for Dja Djedje in the 59th minute and it proved an inspired change.
The replacement made the breakthrough 22 minutes from time, albeit with a stroke of luck.
Mounier was challenged in the area by Rudy Mater and the ball bounced off his chest, over Penneteau and into the net.
Nam Tae-hee fired just over the top at the other end as Valenciennes came close to a leveller, but Mounier’s second in stoppage time killed off their challenge.
Clerc found space down the right and crossed for Mounier to tap home.