With 90 seconds to go, Nigel Davies' side led 23-17 and looked to have the game in the bag. With 30 seconds to go, they were looking at a 23-24 defeat.
There was still time for one last scrum. It was a mess, to be honest, but Gloucester were awarded the penalty. With Freddie Burns replaced, up stepped Billy Twelvetrees and the centre kept his cool to win the game.
It was tough on the Saints but, then again, defeat would have been harsh on Gloucester who really took the game to their in form visitors.
Had a number of gilt-edged chances not been spurned, Gloucester could have been out of sight. They very nearly lived to regret it.
However, Gloucester are now off and running and will now look ahead to next weekend's trip to Newcastle with renewed confidence.
For now, though, it's a case of just enjoying the win and allowing the blood pressure to drop a little.
On a gorgeous afternoon at Kingsholm, it was first blood to the Saints in slightly fortunate circumstances.
An overthrown Saints lineout bounced nicely for Luther Burrell who made the initial break. Gloucester got back, but quick ball to the right found Ben Foden, who cut back against the gain to score. Myler added an easy conversion.
It was a blow for the Cherry and Whites but, as so often happens when a ball goes astray in midfield, the defence was caught off guard.
Gloucester responded well, and James Simpson-Daniel was almost through, only for a despairing tackle to bring him down in full flight.
There was real ambition from the home side, and a kick to the corner gave the pack a chance to pick and drive with real purpose which lifted the crowd and earned a 14th minute penalty, which Burns slotted with ease.
However, the fly half was off target from a long way out three minutes later when Akapusi Qera won a penalty for great work at the breakdown.
More great work from the pack almost resulted in a superb home try moments later. Burns' measured grubber saw Henry Trinder race through but lose control as he looked to ground the ball for the try.
Northampton cleared their lines, but promptly lost number eight Sam Dickinson to the sin bin for tackling James Simpson-Daniel in the air as the winger took a high ball.
It had been a good spell for Gloucester, but disaster nearly struck when a big hit in midfield jarred the ball loose from Billy Twelvetrees.
Burrell gathered and moved dangerously into the home 22. But the Gloucester pack defended the fringes, followed by an awesome tackle and steal from Henry Trinder to avert the crisis.
Gloucester then spurned a glorious chance, as a nice offload Tom Savage put Sione Kalamafoni rampaging into the clear, but the Tongan couldn't find either Cook or Simpson-Daniel outside him with a score beckoning.
Gloucester continued to stretch the visitors defence, but the Saints extended their lead on 37 minutes, a rare trip downfield resulting in a penalty for Myler.
Nigel Davies' side weren't dismayed. A slick backs move saw Burns on the loop, before finding Rob Cook in space who moved it on to Charlie Sharples. The winger had work to do, but showed great strength to score in the corner.
A pulsating half came to an end with Northampton clinging on to a 10-8 lead. It had been a cracker of a game to date, with Gloucester producing probably their best 40 minutes of the season.
In fact, had they taken their chances, they could have gone into the interval with a decent lead.
Northampton had soaked up a lot of pressure in the first half, but looked dangerous whenever they moved into Gloucester territory. There was certainly more to come from them and it was all set for a big second half.
And it started with a bang, Gloucester turning over Saints ball to establish great field position. A quick tap from Cowans caught Saints napping, and Billy Twelvetrees was on his shoulder to take the pass, sidestep Luther Burrell and dive over. Burns' conversion made it 15-10.
Northampton hit straight back as Gloucester failed to clear their lines from the restart. The driving maul took a while to set, but it was effective and Manu Samoa claimed the score. Myler's conversion put Saints back in front at 15-17.
It was a fine response, and Gloucester's defence was at full strength moments later, with Sharples just tackling George North into touch at the corner.
The game continued to be played at 100 miles an hour, and a Burns penalty swung the pendulum back Gloucester's way after 55 minutes following fine work from Rob Cook, the full back gathering a high ball and breaking downfield.
It was nailbiting stuff, and Burns turned down a kickable penalty in favour of a quick tap, but was brought down just short of the line and the chance was gone.
The Cherry and Whites weren't to be denied though. The pack disrupted Saints scrum ball and James Simpson-Daniel had room to run. The winger drew his man, offloaded expertly and Elliott Stooke marked his debut with a memorable try.
Gloucester pressed for the killer score, to try and put Northampton away. However, the visitors remained resilient as time ebbed away.
The Cherry and Whites looked to have it won. However, they turned the ball over and George North inspired a dramatic try for Jamie Elliott. Myler's conversion looked to have sneaked the in for the Saints.
Cue the late drama and, from a Gloucester perspective, referee Fox's arm went the right way.
Overall, the win was deserved, but the manner will have supporters and pundits alike debating the final moments for quite some time.
|Gloucester Rugby Score Card|
|Northampton Saints Score Card|