Saints won a dubious penalty and when home prop Rhys Gill kicked the ball away in dissent, referee JP Doyle sent Saracens back a further 10 yards, taking the attempt within Myler's range.
It was still inside his own half, however, and the penalty hit the crossbar to allow relieved Saracens to return to second place in the Premiership.
England centre Owen Farrell had restored Saracens' lead after stepping off the bench to end Northampton's fightback before 18,865 fans in Milton Keynes, the club's sixth 'home' venue this season.
Saints had hit back after slipping 11-0 behind by scoring 16 unanswered points through a try from flanker Phil Dowson and 11 points by fly-half Stephen Myler.
The inaccuracy of the usually-reliable Charlie Hodgson aided their comeback with the former England fly-half missing three successive kicks, resulting in Farrell taking over.
The nail-biting climax seemed highly-improbable as Saracens coasted into a sixth-minute lead when a perfectly-executed line out catch and drive from 10 metres out ended with hooker John Smit scoring his first Premiership try.
When Hodgson landed a penalty shortly after, they were 8-0 ahead and in full control.
Seeking a repeat try as the opening quarter neared its conclusion, the overwhelmed Northampton pack conceded a penalty which Hodgson sent between the uprights.
Saints' backline also came up short as they butchered a pre-planned move, giving up possession that enabled Saracens to renew their assault.
Sloppy handling and juggled passes then crept into the home side's game and the next score was produced by Northampton with Dowson skipping through two tackles to power over.
Myler added the conversion but Saints were force to produce some heroic defending on their line, eventually pinching a crucial turnover to keep Saracens at bay.
Prop Brian Mujati limped off five minutes before half time, but Myler kicked a penalty soon after to slash the deficit to a single point and lift Northampton's spirits.
Broken play was the visitors' most profitable area of attack and by half-time they were back in contention at 11-10.
Two minutes after the interval they crept ahead for the first time when Myler punished Mako Vunipola for collapsing a scrum by booting three more points.
The successful kick was sandwiched by two missed shots at goal by the off-key Hodgson, who then wasted a third in quick succession.
Saracens, knowing they had surrendered the initiative, made a bold move in the 54th minute when they changed their entire front row, bringing on Schalk Brits, Gill and Carlos Nieto.
The changes backfired almost immediately as a collapsed scrum by the halfway line gave Myler sight of the posts and the fly-half made no mistake with a giant kick.
With Hodgson misfiring, Saracens brought on Farrell and he made an impact by nudging Saracens 17-16 ahead with the second penalty won after Northampton had foiled an attack with a turnover.
For the first time in the match Ben Foden exploded into life, dancing through a series of tackles but the move broke down when the offload went to ground.
It was the prelude to an thrilling finish, however, that ended with Myler failing by the slenderest of margins.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.