Defenders Fraser Horsfall and Jon Guthrie both netted as Northampton recorded a fourth straight victory at Harrogate.
The defensive duo scored either side of a Jack Diamond equaliser to secure a 2-1 triumph for the promotion hopefuls.
Earlier, Northampton made a confident start to the match and Sam Hoskins was unlucky not to open the scoring when his free kick, won by Nicke Kabamba, struck the inside of Mark Oxley's right-hand post.
But the Cobblers did go on to net in the seventh minute from the contest's first corner when Horsfall stabbed an eight-yard effort in amid a crowd of home defenders following Mitch Pinnock's inswinging delivery from the right.
Harrogate hit back midway through the half when Diamond received a pass from Alex Pattison and ran across the edge of the away penalty box before finding the space to rattle a terrific effort into Liam Roberts' top-left corner.
The visitors then forged ahead for a second time in the 49th minute when Pinnock's free-kick from the right was met by Guthrie, who guided a powerful downward header into Oxley's bottom-left corner for the winning goal.