The 26-year-old former Inter Milan and Manchester City striker opened the scoring from the penalty spot after seven minutes and struck again 12 minutes from full time when he headed home a Ricardo cross.
Florian Thauvin cancelled out Balotelli's opener and former Swansea City striker Bafetimbi Gomis put Marseille ahead.
After Italy striker Balotelli equalised, Nice snatched the points when Wylan Cyprien struck from long range.
Nice are second in Ligue 1, behind leaders Monaco on goal difference.