Rob Cook's second-half try helped Gloucester turn round a half-time deficit to secure a narrow Premiership victory over local rivals Bath.
Stephen Donald's try after only 32 seconds gave the visitors a great start, the fly-half adding both the conversion and a consequent penalty.
Two Freddie Burns penalties then closed the gap to 10-6 at half-time.
But Cook put Gloucester ahead for the first time, Burns adding the extras, as well as a drop-goal, to seal victory.
The visitors have now won only once in the last 10 meetings against their near neighbours, who move up to fourth in the Premiership table.
Bath had a dream start to the local derby when Donald went over within the first minute.
The New Zealand international, who kicked the winning penalty in the received a pass from Michael Claassens, dummied cleverly and ran 40 metres to score a fine solo effort before adding the conversion.
Bath had a Nick Abendanon try disallowed after Kyle Eastmond was adjudged to have stepped out of play.
Donald was successful from 20 metres to push Bath's lead out to 10-0, but Burns responded with a penalty of his own from Gloucester's first chance, on the half-hour mark.
The fly-half landed his second kick two minutes later when the hosts closed the gap to four points at the break.
Burns missed the chance to reduce the arrears to one point four minutes after half-time with an unsuccessful penalty.
Gloucester were then on the wrong end of a Television Match Official decision when Shane Monahan's try was disallowed for double movement.
The TMO was again needed just minutes later, but this time Cook's try in the corner was given the green light and Gloucester went 13-10 ahead as Burns kicked the extras.
The hosts could have added a second try but the TMO incorrectly ruled that Monahan was in touch before offloading.
However, Burns's drop-goal gave the home side some breathing space as Gloucester held firm under some late Bath pressure.
VIEW FROM THE DRESSING ROOM
Gloucester director of rugby Nigel Davies:
"We had no control of the first half. We were on the back foot almost everywhere.
"It was important to sort things out. It was certainly a game of two halves and we managed to bring width and continuity in the second period.
"Perhaps we were a bit complacent in the build-up this week, but it was pretty easy at half-time because we had been so far off the game. We knew what we had to do.
"We showed the resilience and composure which is a hallmark of this team."
Bath coach Toby Booth:
"We have got to be good enough to take the referee out of the equation and look after ourselves.
"We deserved to be a little further in front than 10-0, but you need to convert when you are in the ascendancy.
"There is plenty to be positive about though.
"The Premiership season is a long road and there were plenty of positives today, but make no bones about it we are bitterly disappointed with the result."
Gloucester: Cook; Monahan, Trinder, Twelvetrees, Simpson-Daniel; Burns, Robson; Wood, Edmonds, Harden; Savage, Hamilton (capt); Kalamafoni, Qera, Morgan.
Replacements: James for Savage (45), Cowan for Robson (58), Knight for Harden (58), Britton for Wood (61), Murphy for Edmonds (61).
Not Used: Evans, Tindall, M Thomas.
Bath: Abendanon; Eastmond, Hipkiss, Vesty, Biggs; Donald, Claassens; James, Mears (capt), Wilson; Day, Attwood; Fearns, Skirving, Taylor.
Replacements: McMillan for Claassens (51), Skuse for Taylor (52), Spencer for Day (60), Batty for Mears (63), Perenise for Wilson (63), Catt for James (69), Cuthbert for Hipkiss (69), Devoto for Donald (77).
Referee: Dave Pearson (RFU).