Bradley Johnson grabbed a stoppage time winner as Northampton poured cold water on Scunthorpe's promotion plans.
A win for the Iron could have sent them up but Alex Pearce gave Northampton the lead, converting David Hunt's corner.
Kenny Deuchar missed from three yards and then had an effort cleared off the line as Northampton dominated.
Billy Sharp equalised in the 57th minute, nipping in at the near post but Johnson forced in very late on before being dismissed for celebrating.
Northampton: Bunn, Pearce, Hughes, Doig (Dyche 25), Crowe, Gilligan, Hunt, Bradley Johnson, Holt, Cox (Robertson 83), Deuchar.
Subs Not Used: Dunn, Aiston, Kirk.
Booked: Hughes, Gilligan, Bradley Johnson.
Goals: Pearce 16, Bradley Johnson 90.
Scunthorpe: Murphy, Byrne, Crosby, Foster, Williams, Hinds, Goodwin, MacKenzie (Taylor 54), Beckford, Sharp, Hurst (Butler 83).
Subs Not Used: Lillis, Quinn, Baraclough.
Booked: Williams, Sharp, Crosby, Byrne.
Goals: Sharp 57.
Ref: P Crossley (Kent).