London Irish sprang a surprise as they beat Northampton 39-17 at the Madejski Stadium, but the Saints kept their place at the top of the table thanks to Harlequins losing 42-28 to Exeter at Sandy Park.
Bath made a powerful start in pursuit of a first win on Gloucester soil since 2006 after fly-half 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 set the scoreboard moving.
Burns, who has played himself into England fly-half 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 September 1.
Jonathan Joseph inspired the biggest upset of the Premiership season so far as London Irish destroyed Northampton's unbeaten record at the Madejski Stadium, securing a 39-17 victory.
The England centre touched down for the opening try and he played a key role in scores by David Paice and Topsy Ojo as London Irish turned the Premiership table on its head. Jamie Gibson wrapped up the Exiles' first bonus point of the season with their fourth try to cap another outstanding individual display.
By the time Ken Pisi and then Phil Dowson scored late consolation tries for Northampton, the Saints already trailed 33-3 and their goose had been well and truly cooked.
Exeter Chiefs celebrated their 50th Premiership match with 42-28 bonus point victory at Sandy Park as reigning champions Harlequins missed the opportunity to go back to the top of the table following Northampton's defeat.
Brett Sturgess, Ben White, Jason Shoemark (two) and Sireli Naqelevuki were the try-scorers for the impressive hosts, while Gareth Steenson contributed 17 points with the boot.
Nick Evans scored a try and kicked two penalties and a conversion for the visitors, with Ugo Monye and Karl Dickson also crossing. Rory Clegg added a conversion and penalty but it was not enough to avoid defeat.