Freddie Burns broke London Welsh hearts with a penalty five minutes from time as Gloucester secured a hard-fought 15-14 win at Kingsholm.
Wing Phil MacKenzie's 52nd-minute try and three penalties by fly-half Gordon Ross put Aviva Premiership basement club Welsh on the verge of only their fifth league win this season.
It would have closed the gap to two points on Sale Sharks - 14-13 conquerors of Bath on Friday night - but Gloucester fly-half Burns had other ideas.
Although the England international missed four shots at goal, he booted five others to keep Gloucester's title play-off hopes alive.
The Exiles, in contrast, are now five points behind Sale with four games left, although that could change early next week.
Welsh have appealed a five-point deduction for fielding an ineligible player - scrum-half Tyson Keats - in the Premiership this season, and the result of their appeal hearing is expected to be made public during the next 72 hours.
They need it to work in their favour, given that their remaining Premiership fixtures are away against Bath and London Irish, plus home appointments with Northampton and Worcester.