Ben Foden was the hero for Saints as they snatched a stunning 27-23 victory in the most dramatic of circumstances at The Stoop.
Jim Mallinder’s men had looked beaten as Ben Botica attempted to put the ball in the stands to end the game, but the wind kept it in and Saints mounted one last attack, sending Foden in for the match-winning score.
It secured a vital victory for Northampton, who have now closed the gap to fourth-placed Harlequins to seven points.
Saints showed huge character to bounce back from their sobering 24-11 defeat at home to Wasps eight days earlier, with Christian Day and Luther Burrell tries sending them in at 17-14 up at the break.
But Quins, who scored through George Merrick and Ross Chisholm, responded well and looked to have won it when Botica kept his nerve to land a penalty.
However, Foden (and the wind) was to have the final say as Saints grabbed the win from the jaws of defeat to keep their Aviva Premiership top-four hopes alive.
Mallinder’s men had produced the response they needed after that Wasps woe - and it owed much to a faster start than the one they had produced at Franklin’s Gardens.
Following some tidy build-up play, Tom Wood crashed over, but after a lengthy consultation with his TMO, referee Greg Garner deemed that a Quins body had got underneath the ball.
Saints continued to push on from the next attack and eventually came away with an easy Stephen Myler penalty from in front of the posts.
But Quins were quick to respond and they scored from their first attack as some slick play ended with lock Merrick scoring.
Evans converted, but Merrick soon gave away a needless penalty, going off his feet at the breakdown, giving Myler the chance to add another three points.
However, in windy conditions, Myler saw his penalty hit the post, handing Quins a reprieve.
It was only temporary though as a blistering break from the impressive Burrell cut Quins apart and Ken Pisi picked up to hand to Day, who had the simple task of running in to score.
Myler converted to give Saints a lead they fully deserved and they should have had a far greater advantage, wasting numbers on the right with an inaccurate pass.
Quins were far more ruthless at the other end, scoring again as a fine move, which included a succession of clever offloads, concluded with full-back Chisholm racing in for the score.
Saints were left scratching their heads at how they were behind again as Nick Evans added the conversion to give his team a four-point lead.
The away side, who were playing with a strong wind in their favour during the first half, continued to create opportunities, but Quins were defending well.
That was until Harry Mallinder broke the line and surged forward, with Burrell running a great support line and taking the pass to score.
Myler belied the tricky kicking conditions to land the conversion and Saints were desperate to hold on to their lead going into half-time.
They managed to, and things got even better as Quins scrum-half Tito Tebaldi was sin-binned for a deliberate knock-on a minute before the break.
Saints were forced into a half-time change as Pisi was forced off with a shoulder injury, giving James Wilson to enter the action.
But it was Quins who struck first in the second period as the home side won a penalty at the scrum and Evans kept his composure to level the scores from the tee.
And the fly-half was soon putting his team ahead after a deliberate Saints knock-on, meaning that when Tebaldi returned, his side had won the sin bin period 6-0.
With the wind in their sails, Quins were flying forward at every opportunity and only a knock-on at the last prevented a third try for the hosts.
It was proving hugely difficult for Saints to get out as the conditions prevented any attempts to kick for territory.
Quins were soon at the door again, turning up the heat with an ominous lineout drive and forcing Wood to infringe, with the flanker being sent to the sin bin.
Saints stood tall to the next drive, winning the scrum as they desperately sought to relieve the pressure.
And they eventually managed to get into the Quins half with a couple of penalties kicked to the corner by replacement fly-half JJ Hanrahan.
Hanrahan decided enough was enough at the third time of asking, pushing a penalty through the posts to level the scores.
But Saints were still down to 14 men and Quins were soon back in the visitors’ half, winning a penalty of their own, which Botica, on for Evans, did well to land.
Quins then tried to grind their way to victory, but after Saints won a penalty with a minute to go, the home side still had some defending to do.
It looked like they’d done it, too, as they turned the ball over, winning a scrum.
All they needed to do was get the ball out and boot it into the stands, and they looked to have done it when Botica took possession.
But as the Quins fans cheered, the wind kept the ball in play, with Saints getting one more chance to attack.
And attack they did, flinging the ball wide, giving Foden the chance to score one of the most dramatic and important tries of the season.
After lengthy celebrations, Hanrahan added the conversion to put the seal on a superb victory for Mallinder’s men.
Harlequins: Chisholm (Swiel 73); Yarde, Hopper, Sloan, Walker; Evans (c) (Botica 62), Tebaldi; Lambert, Buchanan (Gray 40), Sinckler (Collier 73); Merrick, Horwill; Luamanu (Ward 60), Wallace, Easter.
Replacements not used: Evans, Matthews, Waters.
Saints: Foden; K Pisi (Wilson 40), Burrell, Mallinder, Elliott; Myler (Hanrahan 62), Dickson (c) (Kessell 75); A Waller (E Waller 65), Haywood, Brookes; Craig (Matfield 67), Day; Gibson, Wood, Dickinson (Harrison 65).
Replacements not used: Marshall, Denman.