Former Bath player Robbie Kydd scored a late try to salvage what may yet prove to be a precious losing bonus point for Northampton.
It was just reward for a courageous second-half performance in which Saints scrapped for every piece of possession after looking down and out at 22-3 behind on the hour.
Losing control of the game took the edge off the victory for Bath but the win does take them out of the relegation dogfight – for the time being at least.
After a nervous start Bath had been quicker to settle and a Danny Grewcock drive forced Northampton to concede a penalty under the posts. Olly Barkley kicked the goal.
A series of penalties around the rucks and mauls by Northampton allowed Bath to maintain the pressure and Barkley added a second penalty four minutes later.
It was not just his goal kicking that was giving his side the upper hand though.
Saints were repeatedly forced back by his kicks to touch and he might have set up a try for Grewcock on 16 minutes only for Carlos Spencer to intercept before knocking the ball on.
Great defensive work by the Saints kept the home side out as the pressure built but the resistance came at a price when number eight Christian Labit was sent to the sin bin in the 19th minute.
It was no real surprise when Grewcock crashed over for the first try on 20 minutes having won the line out that initially set up the chance.
While Saints hooker Dylan Hartley was having trouble finding his line out jumpers Bath were enjoying plenty of possession although without the precision to finish off.
On 36 minutes however, full-back Nick Abendanon ran back a loose kick from his own 10-metre line, sprinting through a scattered defence until hauled down just short of the line by Bruce Reihana.
Bath kept possession and Abendanon was again on hand to stretch over for the unconverted try.
When Northampton did get a sniff of possession Spencer’s passes repeatedly failed to find the right target.
One of the culprits was wing Matthieu Bourret but the Frenchman made amends three minutes into the second pass by putting Saints first points on the board with a penalty.
Barkley replied with his third penalty on 50 minutes after a punishing driving maul by the Bath back but the home side escaped shortly afterwards when Northampton thought they had scored until Kidd’s pass to Paul Tupai was ruled forward
Barkley made it 22-3 on the hour but Bath then went on the defensive and Saints’ scrum-half Mark Robinson stretched out to score on 68 minutes with Bourret adding the conversion.
As Bath lost their shape Northampton seized the chance of the losing bonus point when Spencer made space for Kydd to score on the left.