|Harlequins (6) 32|
|Tries: Visser, Marchant Cons: Evans 2 Pens: Evans 6|
|Wasps (10) 13|
|Try: Robson Con: Gopperth Pens: Gopperth 2|
Nick Evans kicked 22 points on his final appearance at The Stoop to boost Harlequins' top-six hopes with victory over Premiership leaders Wasps.
On his Stoop swansong, Evans kicked six penalties and converted tries from Tim Visser and Joe Marchant.
Wasps led at half-time through Dan Robson's try but could only muster a Jimmy Gopperth penalty in the second half.
They lost a game they had led at the break for the first time this season.
Defeat left Wasps waiting to secure a home semi-final, and their final game is at home to champions Saracens.
Harlequins travel to Northampton in the final round in a potential shootout for the last automatic place in next season's European Champions Cup.
That they have the opportunity is largely thanks to Evans, who is retiring at the end of the season, and who ran the game superbly and kicked eight of nine attempts from the tee.
His first penalty put the home side ahead but Wasps scored the game's first try as fly-half Gopperth claimed a high ball on his 10-yard line and raced clear before releasing Robson to score.
It helped Wasps lead 10-6 at half-time, but Harlequins quickly resumed control through Evans' boot.
The decisive moment saw Kurtley Beale attempt an interception on halfway, but the pass evaded him and Chris Robshaw galloped forward to send Visser in down the left wing.
Harlequins' second try came in the closing stages as Marchant capped an excellent night by racing under the posts after Dave Ward had created space.
Harlequins director of rugby John Kingston:
"Nick is a legend at Harlequins. For me there are very few of those, but he's one of them. It was nice to see the reception he got from the fans. Knowing him, you'd have a bet on him performing like that in his last game here.
"But we've got to back that up next weekend and that's the big thing. We're trying to qualify for the Champions Cup and that will come down to next Saturday.
"We haven't qualified for the competition for three years so if we did it would be brilliant and we will give everything to achieve that."
Wasps director of rugby Dai Young:
"We didn't get enough possession or territory to cause them problems. Our kicking game was poor and we never built any pressure.
"It wasn't a great performance from us, but give Quins some credit. It was chaos at the tackle area and that wasn't refereed, but that's not why we lost.
"We'll dust ourselves off because there's no point beating ourselves up. We were second best and we know we have to work hard for Saracens."
Harlequins: Brown; Yarde, Marchant, Roberts, Visser; Evans, Care (capt); Marler, Buchanan, Sinckler, Matthews, Horwill, Robshaw, Wallace, Luamanu.
Replacements: Gray, Lambert, Collier, Merrick, Ward, Dickson, Swiel, Alofa.
Wasps: Le Roux; Wade, Daly, Beale, Bassett; Gopperth, Robson; Mullan, Taylor, Swainston, Launchbury (capt), Myall, Haskell, Young, Thompson.
Replacements: Cruse, McIntyre, Cooper-Woolley, Rowlands, Hughes, Simpson, Cipriani, Leiua.
For the latest rugby union news follow @bbcrugbyunion on Twitter.