With both teams readily running possession - and a referee in J P Doyle who allowed the game to flow - it produced an encounter of the highest quality that went Gloucester's way when flanker Akapusi Qera touched down 10 minutes from time.
Quins led 12-3 at half-time following tries from hooker Rob Buchanan and wing Sam Smith, but play-off contenders Gloucester refused to lie down and wing Jonny May's 43rd-minute score kept them in contention.
Quins will drop to fourth spot, one place above Gloucester, if Northampton beat Leicester on Saturday, as for the first time in rugby director Conor O'Shea's three-year reign they slipped to a third league loss on the bounce.
Fly-half Nick Evans chipped in with a penalty and conversion for Quins, while his opposite number Freddie Burns converted both Gloucester tries and kicked a penalty as his team held their nerve to prevail.
It was fast, furious and occasionally frantic, and a crowd of just under 15,000 revelled in the attacking intensity that both sides brought to the party.
Counter-attacking was the order of the day, rather than a safety-first kicking approach, which resulted in a game to savour.
- Sports & Recreation