Rochdale started well at Sixfields, with Andrew Tutte forcing Lee Nicholls into a decent save.
But the Cobblers broke the deadlock in the 32nd minute when Clive Platt headed home a cross from Chris Hackett.
Boosted by the goal, Northampton took control of the half and Ben Harding shot just wide following good work from the impressive Hackett and Platt.
New signing Roy O'Donovan was denied by keeper Josh Lillis after the restart but Rochdale again started the half well. It took a brilliant save from Nicholls to deny George Donnelly and substitute Ashley Grimes went close moments later.
Lillis twice denied Hackett in quick succession but Kennedy deservedly equalised in the 64th minute when he turned to beat Nicholls after good work from Kevin McIntyre.
Kelvin Langmead restored Northampton's advantage two minutes later when Harding's corner was not fully dealt with by Lillis and the central defender turned the ball in for his sixth goal of the season.
Top scorer Adebayo Akinfenwa increased Northampton's lead from a 75th minute penalty after Hackett was tripped in the box and O'Donovan saw a late effort come back off the upright.