The 10 men of Nancy snatched a late winner to beat Boulogne and edge closer to the European places.
Nancy took the lead through Issiar Dia but were quickly pegged back as Alexandre Cuvillier poked home from close range after 15 minutes.
The game looked to be heading for a draw as Nancy, who had dominated without scoring, were reduced to 10 men with the loss of Jordan Loties with 13 minutes to go, but Youssouf Hadji nodded in the winner with seven minutes left.
Nancy began the game on the front foot, with Ibrahim Kone needing to make a good save to deny Hadji after five minutes.
The opening goal came after 10 minutes, with Loties picking out Dia who volleyed home from close range.
However, their lead lasted only five minutes as Antony Lecointe crossed from the right and Cuvillier prodded the ball past Damien Gregorini.
At the other end, Dia tried his luck from 30 yards but sent the ball just the wrong side of the post.
Gregorini then had to make a good save to keep out Matt Moussilou's shot on the half-hour mark.
But it was Nancy who remained on top and Kone had to make a fine double save after Julien Feret's pass found Djamel Bakar in a good position.
The visitors continued to attack in the second half, and Kone made another great save to claw the ball off the line after Hadji headed from close range.
Paul Alo'o Efoulou then headed just wide from Feret's free-kick, moments before Nancy were reduced to 10 men.
Loties could have no argument as he kicked out at Guillaume Ducatel.
But despite losing a man, Nancy snatched all three points in the 83rd minute as Alo'o Efoulou released Reynald Lemaitre down the left and he crossed for Hadji to score with a diving header.