But a run of 14 unanswered points in the third quarter put them on course for back-to-back defeats.
But they were unable to conjure up another score that would have snatched victory.
Gloucester missed a chance to take an eighth-minute lead when Ludovic Mercier screwed his penalty wide from near the left-hand touchline and Carlos Spencer was off target at the other end with an ambitious attempt from 55 metres four minutes later.
Northampton missed another chance to take the lead after 14 minutes when James Pritchard’s attempt fell short.
Spencer opted to kick for the corner when Northampton won another penalty and that set up a catch and drive five metres from the Gloucester line.
The Cherry and Whites survived that, but a series of five metre scrums that followed led to a penalty try being awarded after 21 minutes as Gloucester’s scrum buckled under the pressure. Pritchard’s conversion made it 7-0.
Gloucester’s reply was immediate. They were level within five minutes as Peter Richards burrowed over from close range as the visitors cashed in when Northampton were penalised for slowing the ball down.
Mercier converted to make it 7-7 and then missed a penalty after 31 minutes.
The sides were level at the break and Northampton should have gone ahead within three minutes of the restart.
Spencer was unable to gather John Clarke’s pass when he was five metres from the line after Bruce Reihana’s break had started the attack.
But the home side found a way through after 49 minutes with Mark Easter touching down for his first try for the club and Pritchard adding the conversion to make it 14-7.
Gloucester pegged back three points three minutes later with Mercier’s penalty.
But they were back defending their own line moments later and the pressure told when Gloucester skipper Adam Buxton was sin-binned after 55 minutes.
The home side went further clear in his absence. Reihana’s chip through was spilled by Gloucester full-back John Goodridge 10 metres from his own line and Clarke picked up to score.
Reihana’s conversion put the home side 21-10 ahead after 62 minutes before Mercier’s penalty two minutes later kept the visitors in touch.
Gloucester were handed a chance to get back into the game after 72 minutes when Easter was yellow-carded and they grabbed a penalty try after 77 minutes that made the score 21-20.
But they were unable to score again as the home side held on for the win.