Following a first half short on quality but full of good chances, Clive Platt had the ball in the net shortly after the restart but was ruled offside, while at the other end Stacy Long saw a penalty appeal waved away after his shot struck Danny East.
But the introduction of Adebayo Akinfenwa paid dividends for the hosts on the hour. Akinfenwa's neat lay-off from Joe Widdowson's pass enabled Nicholls to race into the box and beat Mikhael Jaimez-Ruiz with a cool finish.
Nicholls almost doubled Northampton's advantage moments later when he skipped past three defenders before seeing his shot blocked.
But Hackett did just that in the 72nd minute, picking the ball up 40 yards out and racing past two defenders before beating Jaimez-Ruiz.
Platt and Akinfenwa could have wrapped the game up but the outcome was never in doubt as the visitors wilted under Northampton's late pressure.