Sochaux's hopes of avoiding the drop received another huge boost with victory at relegation rivals Caen.
The visitors led 2-0 at the break through goals from Sloan Privat and Loic Poujol but they needed a 90th-minute strike from Thierry Doubai to seal the points after Caen had pulled a goal back through Benjamin Nivet just before the hour.
Sochaux, who ended a three-match losing streak with a vital 1-0 win over Nancy last time out, move onto 39 points with the victory, a point above Caen, who themselves are only above third-bottom Ajaccio on goal difference.
Both sides came close to opening the scoring early on, Privet firing a left-footed volley just wide before Caen striker Pierre-Alain Frau headed inches off-target, but it was Sochaux who made the first breakthrough in the 25th minute.
Ryad Boudebouz floated in a free-kick from the left and it was inch-perfect for Privat to head past Alexis Thebaux in the home goal.
Thebaux denied Sochaux a second goal five minutes later when he kept out Poujol's volley, but the midfielder was not to be denied in the 38th minute when he volleyed home right-footed following another Boudebouz free-kick.
Sochaux had two good opportunities to all but finish off the contest at the start of the second half but Thebaux produced fine saves to keep out efforts from Boudebouz and Doubai, and the visitors then found their lead cut in half in the 58th minute when Nivet netted for Caen.
The veteran playmaker had only been on the pitch four minutes after replacing Nicolas Seube when he powered a superb header past Teddy Richert from Livio Nabob's corner.
That gave Caen a foothold back into the game and they very nearly drew level in the 70th minute only for Richert to keep out Nabab's far-post header.
Caen would come no closer than that in the closing stages, though, and Sochaux wrapped up the points three minutes into stoppage time when Boudebouz and Marvin Martin combined to set up Doubai, who thundered an unstoppable shot into the top corner of the net.
Sochaux will now hope to complete their escape from the drop when they host Marseille in the final round, while Caen go to Valenciennes.