Nicholls strike handed the Cobblers their first league win of the season with just four minutes left on the clock.
A frantic opening spell saw Daniel Nardiello go closest to breaking the deadlock, turning smartly on the edge of the box before curling his shot just wide.
But the first real moment of quality produced the breakthrough for Cobblers in the 26th minute. Chris Hackett received a short throw-in from Nicholls and cut inside before rifling a fierce drive past Scott Shearer from 20 yards.
Jason Taylor went close to a quick equaliser but his angled drive was beaten out by Lee Nicholls. Ben Harding went even closer to doubling Northampton's advantage when his screamer from 25 yards struck the bar.
Rotherham made the most of the let-off and finally got back nito the game. Ian Sharps flashed a header wide of the near post, Michael O'Connor was off target after breaking into the box and Ben Pringle tested Nicholls as they looked for the equaliser. It came from the impressive Pringle three minutes before the interval when his deflected shot from the edge of the box left Nicholls stranded.
Substitute Kieran Agard should have given Rotherham the lead midway through the second half, racing onto Kayode Odejayi's flick-on before blazing over from six yards. Agard saw his close range effort saved by Nicholls who then tipped over Pringle's 25 yarder as the Millers pressed hard for the winner.
But it was the Cobblers who grabbed it when a quick break by the excellent Hackett ended with Nicholls exchanging passes with Platt before rounding Shearer to score from a tight angle.