Pushed all the way by the relegation-threatened Mariners, Northampton were helped by the sending-off of Oliver Lancashire.
Bayo Akinfenwa punished the home side with the winning goal which puts Town back in a play-off place ahead of Saturday's games.
Boss Ian Sampson admitted afterwards he 'felt for Grimsby a little bit' but told the official club website: "The main thing for us was to do our job and get the three points".