The Cobblers rocked leaders Swansea with three early goals and could have won by a bigger margin had they taken their second-half chances.
Poul Hubertz gave Northampton a 14th-minute lead, scoring from close range from Daniel Jones's corner.
Alan Tate then turned a Jones cross into his own net five minutes later and Hubertz grabbed his second from the penalty spot in the 22nd minute.
Swansea striker Jason
Jason Scotland pulled a goal back six minutes later – his 23rd of the season – scoring at the second attempt after Mark Bunn saved his first effort and Guillem Bauza should have scored moments later but glanced his header wide.
Danny Jackman restored Northampton's two-goal advantage seven minutes after the re-start with his first for the club, while Bayo Akinfenwa missed a sitter against his old club, adding to his first-half frustration when he headed against the bar.
Hubertz, Andy Holt, and Ryan Gilligan all missed good chances to extend Northampton's lead before Scotland grabbed his second goal seven minutes from the end.
FULL REPORT TO FOLLOW
TEAMS:
Northampton
- 01 Bunn
- 02 Crowe
- 05 Gyepes
- 22 Little
- 21 Jones
- 18 Gilligan
- 14 Burnell
- 03 Jackman
- 11 Holt
- 23 Hubertz
- 10 Akinfenwa
Substitutes
- 13 Dunn,
- 07 Coke,
- 12 Henderson,
- 19 Dolman,
- 20 Dyer
Swansea
- 21 De Vries
- 22 Rangel
- 05 Tate
- 15 Lawrence
- 14 Painter
- 28 Butler
- 06 Bodde
- 07 Britton
- 18 Robinson
- 23 Bauza
- 09 Scotland
Substitutes
- 03 Austin,
- 08 Pratley,
- 11 Duffy,
- 20 MacDonald,
- 29 Brandy
Ref: Jon Moss