Chris Wilder's side led 3-0 and 4-1 during the game at the Globe Arena and the manager told BBC Radio Northampton afterwards that, although he was disappointed at the goals conceded, it was a 'great result' for his team as they recorded back-to-back victories and moved up to 8th place in League Two.
Lawson D'Ath and Sam Hoskins gave the Cobblers a two-goal half-time lead against a side that had been looking to record their fifth successive win in all competitions.
Joel Byrom then made it three just after half-time and Dominic Calvert-Lewin made the game safe just minutes after Tom Barkhuizen had scored for the hosts who got a late consolation through a Northampton own goal.
The win sets up an attractive home game next Saturday at Sixfields against current League Two leaders Leyton Orient.