England fly-half hopeful Freddie Burns gave Bath a huge fright in front of a packed Recreation Ground with a charge-down try on the hour but the home side nervously closed out the victory.
Bath moved into second place - for 24 hours at least - with this 15-13 success but they flattered to deceive and relied on the boot of George Ford for all their points.
The home side utterly dominated possession and territory but their misfiring midfield never really looked like creating a try as Gloucester scrapped for every loose ball, at the cost of 19 penalties. Burns, Bath-born and bred, also scored all his side's points.
With only Davey Wilson kept back by England, fourth-placed Bath were able to name a strong squad, bringing back lock Dave Attwood after four weeks out with a rib problem to play against his former club.
Bath had not lost at home in the Aviva Premiership in 2013, their only defeat in 12 matches at the Rec in all competitions being to Stade Francais in an Amlin Cup quarter-final on April 6. Gloucester, by contrast, had managed just one away win in seven matches so far this season.
Showers swept the ground before kick-off and in the sodden conditions Ford needed no invitation to push Gloucester back into the corners. Within five minutes, he was late-tackled by Matt Kvesic and the young fly-half kicked the opening points.
Bath continued to press but lineout frailties undermined their efforts even before Rob Webber threw too long on his own 22 and almost presented prop Dan Murphy with a try at the other end on 22 minutes. Murphy was injured and had to be replaced by Yann Thomas.
Gloucester had already had their problems in the scrum, however, and when the visiting pack again splintered under pressure, Ford kicked his second penalty on 27 minutes.
In a stop-start first half, Ford made it 9-0 on the half-hour when Darren Dawidiuk tried to strip the ball from Anthony Perenise while off his feet.
Almost immediately, Burns pulled back three points when Jonathan Joseph was guilty of a deliberate knock-on.
Ford had two more chances to send Bath in with a two-score lead at half-time but the ball drifted wide both times.
The visitors conceded three penalties in as many minutes at the start of the second half though and Ford accepted the chance to make it 12-3 from wide on the right.
As Bath, now in control of the lineout too, pounded away at the right hand corner, Gloucester continued to leak penalties. They ignored the inevitable warning from Wayne Barnes and lost Rupert Harden to the sin-bin soon afterwards.
Ford missed the relatively straightforward penalty though and then agonisingly watched his opposite number, Burns, hit the post from 45 metres.
Worse was to follow as Burns charged down an attempted clearance by Ford, picked up the ball just short of the line and dived over. The conversion was a simple affair.
The Bath fly-half steadied his nerves to kick his fifth penalty but Burns hit back with an excellent effort on 67 minutes to narrow the scores to 15-13 after Watson was yellow-carded for a deliberate knock-on.
As the tension mounted, Ford scuffed an attempted drop-goal with his left foot and was off-target again with a difficult penalty but Gloucester were trapped in their own half until the final whistle.