Nancy's Yohan Mollo struck a minute from time after Mohamed Sissoko had cancelled out Bakaye Traore's first-half opener as PSG stayed second with 60 points from 30 games.
PSG could even now be threatened by third-placed
Nancy midfielder Traore raced into the PSG central defence to beat Salvatore Sirigu from close range after 18 minutes.
The visitors dominated possession but failed to find the target before the break and eventually suffered their first league defeat in four months.
Sissoko equalised five minutes into the second half with a header from a Sylvain Armand cross and although Carlo Ancelotti's side piled on the pressure, Nancy held on.
They claimed all three points when Mollo beat Sirigu from the edge of the box after Maxwell lost the ball in the midfield.
Anthony Mounier struck twice for the visitors and Francois Clerc poked home the winner a minute from time as St Etienne stayed sixth with 46 points from 30 games, seven points adrift of third-placed Lille. Nice are sixth from bottom on 31 points.
The top two qualify for next season's Champions League and the third-placed side go through to a play-off tie.
St Etienne went ahead in the 22nd minute when Max Gradel unleashed a 30-metre piledriver, only for Nice to equalise through Mounier in the 34th.
Les Verts restored their advantage thanks to a Sylvain Marchal header before the break but the unmarked Mounier levelled 11 minutes into the second half with a diving header.
Former France fullback Clerc then sealed the win when he converted a pass from Renato Civelli.
Benoit Tremoulinas opened the scoring with a penalty in the 71st minute but Thomas Guerbert snatched a point for the visitors in stoppage time.
Sochaux are third from bottom on 30 points behind Brest on goal difference with Auxerre three points from the safety zone.