Mahamane Traore broke the deadlock six minutes into the second half, deflecting in Nemanja Pejcinovic's shot after a corner had led to a goalmouth scramble.
Nice doubled its lead following another corner, the clearance coming out for Didier Digard to drive powerfully into the back of the net.
Dario Cvitanich sealed the result seven minutes from time, lobbing goalkeeper Simon Pouplin from 20 yards.
Cvitanich also had a first-half goal ruled out for offside in what looked a harsh decision.
Sochaux remains just a point off the bottom three.