Harry Mallinder was the last-gasp hero for Saints as they kept their Champions Cup hopes alive at Franklin’s Gardens on Sunday night.
Mallinder, making only his third appearance for Northampton, latched on to a George North knock-down and ran in for a final-minute score that earned a 19-15 victory.
Glasgow were left to rue the sin-binning of Tim Swinson, who was shown a yellow card for punching Mike Haywood in the 75th minute.
That left them a man down, but Saints needed a try at 15-12 behind, and full-back Mallinder, the son of Saints boss Jim, provided it, to the delight of the home faithful.
Glasgow had gone ahead thanks to four Finn Russell penalties and one from Stuart Hogg, and Russell had even missed a couple of simple attempts as the home side struggled with their discipline.
Saints had scored early on as a lineout drive provided a try for Teimana Harrison, and the hosts used the same tactic to send Christian Day over in the second period.
Glasgow fought back, but Mallinder had the final say to ensure Saints can still clinch one of the three best runners-up spots, although they will know they need to perform much better in their final Pool 3 game, at Scarlets on Saturday night.
Saints had gone into the Glasgow encounter aware that only a win would do, and they got an early let-off as Scotland full-back Hogg narrowly missed an ambitious penalty attempt from close to halfway.
The Warriors were made to pay for that miss on 11 minutes as Saints put a relentless squeeze on at the lineout, eventually making their pressure pay through Harrison.
Hanrahan capped that fine work from the forwards with a superb touchline conversion, and Saints had the start they were looking for.
Russell had a simple chance to respond a minute later, but he delighted the home fans with a poor penalty miss.
But Glasgow were getting a foothold in the game and it wasn’t long before the fly-half was able to atone for his earlier miss, giving his team their first points with a penalty.
Saints were struck with an injury blow soon after as Tom Collins was involved in a clash with Hogg, who inadvertently kneed the wing in the head while gathering a high ball.
Mallinder was introduced for his European bow and Glasgow immediately tested him with a couple of high balls, but he passed with flying colours.
The Warriors were building up a head of steam though and with Hanrahan struggling to command the game, Russell was soon landing another penalty for the away side.
After such a bright start, Mallinder’s men were finding it difficult to get out of their own half and they were relieved to go in ahead at half-time.
And they were to breathe another sigh of relief early in the second half as Russell missed another simple penalty chance to go with the one he failed with in the first period.
But he was soon making amends again, giving the Scottish side the lead for the first time in the game.
It was no more than they deserved, having dominated possession and territory since Saints scored their early try.
But it served to sting Saints into life and another dominant lineout drive brought a try for Day.
Hanrahan missed the conversion and was immediately replaced, with Stephen Myler’s arrival greeted with a big cheer from the home fans.
Russell was soon levelling things up after the Warriors won a rare scrum penalty and the away side were soon standing tall at the other end as Saints missed a big chance to score.
That gave the away side a platform to build on and they earned yet another penalty in the Saints half, with Hogg slotting it with aplomb.
Saints needed a huge effort in the final 10 minutes and they were helped by a moment of madness from Swinson, who was sin-binned for punching Mike Haywood.
Saints eventually made their man advantage pay as, with the penalty coming, Myler’s cross-field kick was plamed down by North and Mallinder finished with ease.
Myler landed the conversion to put the gloss on a win that had at times looked unlikely, but that is so precious in the bid to reach the quarter-finals.
Saints: Foden; Collins (Mallinder 25), G Pisi, Burrell, North; Hanrahan (Myler 54), Dickson (c) (Kessell 75); A Waller (E Waller 63), Hartley (Haywood 57), Hill (Denman 71); Lawes, Day; Gibson, Wood, Harrison (Fisher 57).
Glasgow: Hogg (Weir 77); Jones (Naiyaravoro 57, Dunbar, Johnson, Lamont; Russell, Price; Reid (Allan 64), MacArthur (Mamukashvili 62), Puafisi (Fagerson 54); Nakarawa, Gray (c); Wilson, Fusaro (Swinson 68), Ashe (Favaro 57).
Referee: Romain Poite (France)