Forrester's try helped maintain Gloucester's unbeaten home league record
Gloucester 34 (24)
Tries: Wood, Bailey, Forrester, Foster
Con: Walker 4
Pens: Walker 2
Harlequins 25 (8)
Tries: Keogh, Williams, Fuga, Brown
Gloucester kept up the pressure on Premiership leaders Leicester with a comfortable win at Kingsholm.
First-half tries from Nick Wood, James Bailey and James Forrester put Gloucester into a 24-8 half-time lead.
Quins started the second half with a try from winger Tom Williams, but a stunning touchdown from Mark Foster earned Gloucester their bonus point.
Harlequins secured a bonus point of their own late on with tries from Tani Fuga and Mike Brown.
The Cherry and Whites were helped to victory by the contrast in the fortunes between their goal kicker and those who took up the duties for Harlequins.
For Gloucester Willie Walker scored 14 points with the boot, kicking four conversions and two penalties. But Andrew Mehrtens and Adrian Jarvis only managed two successful kicks between them.
Gloucester coach Dean Ryan:
"We got dragged into a mess. It's left us with a taste of disappointment when we should have enjoyed it.
"We have come through the international period winning all but one of our games (at Saracens) and we can't not be happy with that.
"But the game against Harlequins was fairly snatch and grab rugby and that is not what we are about."
Harlequins head coach Dean Richards:
"We threw it away in the first half. We didn't respect their ability in certain quarters.
"To come out and play the way we did in the second half shows we've got a side that is prepared to dog it out, even when the game was lost and that's important.
"We didn't adapt to the hard ground particularly well, and we need to show more composure and our defence has to improve."
Gloucester: Walker; Bailey, Simpson-Daniel, Allen, Foster; Lamb, Richards, Wood, Azam, Forster, James, Brown, Buxton (capt), Hazell, Forrester.
Replacements: Davies, Collazo, Eustace, Pendlebury, Thomas, Goodridge, Keil.
Harlequins: Brown; Keogh, Luscombe, Abbott, Williams; Jarvis, Gomarsall; Jones, Fuga, Nebbett, Kohn, Evans, Vos, Volley (capt), Hala'Ufia.
Replacements: Hayter, Lambert, Spanghero, Guest, So'oialo, Mehrtens, Masson.