Northampton manager Aidy Boothroyd was pleased with the result but not his side's performance after the 3-2 win over Macclesfield.
George Donnelly gave Macclesfield the early lead but Michael Jacobs equalised direct from a corner and Luke Guttridge headed his second goal in as many games to give Cobblers the interval advantage.
Top-scorer Adebayo Akinfenwa grabbed his 10th goal of the season to extend Northampton's lead shortly after the restart but Ben Tomlinson pulled a goal back late on to set up a tense finish.
"It was one of those games in which we didn't play well but even so I never thought we were in any trouble. And I don't mean that disrespectfully," said Boothroyd. "We allowed Macclesfield into the game and their second goal near the end was down to sloppiness again when we should have seen the game out.
"They were two poor goals to concede and goal difference could be very important at the end of the season, so I've had a bit of a moan at the players for that.
"I felt we could have had more goals but you can't play in fits and starts. We started too slowly and just like a boxer, we waited until we were hurt before we responded."