The Chairboys went into the game as league leaders and took a 2nd minute lead through Luke O'Nien but were pegged back by Marc Richards on 35 to take the game into half-time all square.
Then, two goals in four minutes just after the break saw Town march into a 3-1 lead as Lawson D'Ath and Shaun Brisley netted to give the visitors a margin that was sufficient to withstand Danny Rowe's strike for the hosts.
Speaking to BBC Radio Northampton after the game, manager Chris Wilder singled out a player for praise who had previously been told he had no future with the club.
"We controlled the game well, we were composed and we had lots of options all over the pitch.
"John-Joe (O'Toole) had his best game for the football club by a million miles and hopefully he can kick on now."