Nivet, who came off the bench at half-time, beat goalkeeper Steve Mandanda following a corner kick with two minutes to go to give his side their first victory of the season.
Marseille won their first six league matches but have taken just one point from their last three
"We did not do everything we had to. It is a good lesson," Marseille defender Rod Fanni told French channel Canal+.
Nivet, who was playing his 250th French league game, had an earlier opportunity 10 minutes after the break but his header struck the woodwork.
Marseille, who lost striker Andre-Pierre Gignac because of a broken left foot after 23 minutes, had several efforts on target but keeper Yohann Thuram-Ulien denied Mathieu Valbuena's curled free-kick and Charles Kabore's powerful strike in the second half.
Earlier, Olympique Lyon moved up to third on 18 points behind Marseille with a 1-0 win over Stade Brest 1-0 thanks to a fine lob from Bafetimbi Gomis.
- Steve Mandanda