Harlequins moved five points clear of Gloucester after they overcame the Cherry and Whites 29-26 at the Twickenham Stoop on Saturday.
Quins' points in the first-half came courtesy of two penalties from Nick Evans and a try for Charlie Walker while Gloucester had two penalties from Greig Laidlaw and Bill Meakes' five-pointer, which meant it was 11-13 at the break.
However it was Harlequins who stole victory with another two penalties for Evans and tries for Marland Yarde and Ollie Lindsay-Hague in the second-half.
Gloucester were denied the victory and, despite another penalty for Laidlaw and two tries for Charlie Sharples and Dan Robson, they still lost 29-26.
Walker claimed the first points of the game when the ball was worked down field brilliantly from the penalty on halfway, eventually finding the finisher, who sprinted down the wing to cross for the try for the Quins.
Gloucester claimed the first penalty which Laidlaw slotted over before Evans replied with his own for Harlequins.
Both fly-halves then scored another penalty each to keep the score to within two points before Gloucester found the try line. A fantastic dummy by James Hook set up Meakes who smashed through the defence to land under the posts and score the try to put his team back in the lead.
Harlequins' Joe Marler was shown a yellow card on 36 minutes, after the referee got tired of the home side's constant infringements at the scrum. Gloucester failed to take advantage in the remainder of the first half but still went into half-time in the lead, 11-13.
The visitors opened the scoring in the second-half when Sharples was able to dive over the line undefended on the wing.
Evans claimed two further penalties to bring Harlequins back to within a single point of their visitors. However, the home side then had Jack Clifford sent to the sin bin for a dangerous tackle and Laidlaw nailed the resulting penalty for Gloucester.
Despite being ahead, things went from bad to worse for Gloucester when they had two players shown yellow cards on the 68th minutes, Ross Moriarty for collapsing the rolling maul and Sharples for an intentional knock down.
With their visitors down to just 13 men, Quins took advantage, Yarde joined the back of the rolling maul and dotted over in the corner.
Harlequins then worked the ball brilliantly up the field, keeping it alive until it was able to find Lindsay-Hague who sailed over to score.
Robson claimed a try for Gloucester on the 78th minute but it was not enough and his side went down 29-26.
Tries: Walker, Yarde, Lindsay-Hague
Pen: Evans 4
Tries: Meakes, Sharples, Robson
Pen: Laidlaw 3
Harlequins: 15 Ollie Lindsay-Hague, 14 Marland Yarde, 13 Asaeli Tikoirotuma, 12 Harry Sloan, 11 Charlie Walker, 10 Nick Evans, 9 Danny Care, 8 Jack Clifford, 7 Chris Robshaw, 6 Luke Wallace, 5 George Robson, 4 Nick Easter, 3 Matt Shields, 2 Dave Ward, 1 Joe Marler (c).
Replacements: 16 Rob Buchanan, 17 Mark Lambert, 18 Darryl Marfo, 19 Charlie Matthews, 20 Netani Talei, 21 Karl Dickson, 22 Ben Botica, 23 Ugo Monye.
Gloucester: 15 Steve McColl, 14 Charlie Sharples, 13 Bill Meakes, 12 Billy Twelvetrees (c), 11 Jonny May, 10 James Hook, 9 Greig Laidlaw, 8 Gareth Evans, 7 Jacob Rowan, 6 Sione Kalamafoni, 5 James Hudson, 4 Tom Savage, 3 John Afoa, 2 Richard Hibbard, 1 Nick Wood.
Replacements: 16 Darren Dawidiuk, 17 Dan Murphy, 18 Sila Puafisi, 19 Mariano Galarza, 20 Ross Moriarty, 21 Dan Robson, 22 Billy Burns, 23 Henry Purdy.
Referee: Luke Pearce
Assistant Referees: Andrew Pearce, Kelvin Stewart
TMO: Rowan Kitt