Adebayo Akinfenwa scored the only goal of the game as Northampton climbed into the play-off places.
The Cobblers created the better chances throughout the game but had to wait until midway through the second half to make the breakthrough.
Akinfenwa, who earlier headed against a post, nodded home Ben Tozer's cross after 69 minutes for his 15th goal of the season.
Wycombe Wanderers also enjoyed a 1-0 home win, beating Dagenham & Redbridge thanks to a 32nd minute goal from Sam Wood.
Aldershot gained a valuable point in their battle against relegation following a 0-0 draw away at draw specialists York.