Paul Cook picked up his first win as Accrington manager as Northampton were swept aside.
Stanley went ahead when the visitors failed to clear their lines and allowed Jamie Devitt to curl home.
Brett Williams, on as a substitute, challenged keeper Lee Nicholls for Blair Adams's cross and forced the ball over the line with his first touch.
Craig Linfield grabbed the winner when he headed home Peter Murphy's right-wing cross.
VIEWS FROM THE DRESSING ROOM
Northampton Town manager Aidy Boothroyd told BBC Radio Northampton:
"We hit the crossbar twice and created more than enough chances despite not playing very well.
"I thought we looked very jaded; we didn't start very well.
"They brought a few new players in which freshened them up. Maybe I should have freshened us up a bit, but when you have got a team that is winning and doing well you stick with it.
"I don't have any complaints today we didn't really deserve to win."