Bath made a powerful start in pursuit of a first win on Gloucester soil since 2006 when stand-off Stephen Donald converted his own first-minute try and then kicked a penalty.
But Gloucester responded from 10-0 adrift through two Freddie Burns penalties, before he added the extras to full-back Rob Cook’s 50th-minute touchdown and then slotted a late drop-goal.
Bath will wonder how they let things slip, especially given their early set-piece control, yet Gloucester were in no mood to relent once they got the scoreboard moving.
Burns, who has played himself into England stand-off contention ahead of the autumn Tests, came up trumps at key moments of an attritional contest.
His kicking contribution made the difference as Gloucester added Bath to their list of early-season scalps and they will head into their European campaign next week unbeaten since 1 September.
They are threatening a place in the play-offs at this early stage of the season but Bath remain an erratic combination who have yet to settle under the coaching direction of Gary Gold and Toby Booth.
England No.8 Ben Morgan returned from injury for Gloucester, while centre Henry Trinder and hooker Huia Edmonds also started and New Zealand scrum-half recruit Jimmy Cowan was on bench duty as the home side looked to make it five Premiership games unbeaten.
Bath were captained by former England hooker Lee Mears in the absence of an injured Stuart Hooper. Dominic Day and ex-Gloucester lock Dave Attwood formed Bath’s second-row partnership, with Leicester old boys Sam Vesty and Dan Hipkiss teaming up at centre.
And the visitors made a stunning start, claiming the season’s quickest Premiership try after just 32 seconds when Donald made a brilliant 40-metre break. The New Zealander sold Gloucester centre Billy Twelvetrees an audacious dummy, then sprinted clear for an opportunist touchdown that he also converted.
Gloucester were rocked on their heels and they almost fell further behind 13 minutes later when brilliant work along the touchline by Bath wing Kyle Eastmond looked to have created a try for full-back Nick Abendanon, but television match official David Grashoff rightly ruled that Eastmond had put a foot on the touchline and Gloucester escaped.
Gloucester, though, could not get into the game, with Bath enjoying scrummaging supremacy through the efforts of their Wales international loosehead Paul James and dictating the flow accordingly. Donald booted a 21st-minute penalty to extend Bath’s lead but Gloucester secured enough territory late in a low-key half that reaped two penalty chances which Burns accepted.
In the second half, Shane Monahan set off on a superb angled run towards Bath’s line, but Tom Biggs – despite conceding considerable height and weight advantage – got underneath his opponent and prevented the touchdown. Gloucester did breach Bath’s defence three minutes later, this time James Simpson-Daniel doing the damage.
Cropping up in midfield, Simpson-Daniel fixed the Bath defence sufficiently to create space out wide and Cook touched down. Burns slotted the touchline conversion, and Gloucester held a three-point lead after fighting back impressively.
Bath looked to re-establish themselves in the game, but Gloucester retained control, and Burns’ 74th-minute drop-goal sealed it.