Wasps held on at the Stoop to deny Harlequins a second comeback victory and top spot in the Premiership table.
The hosts stunned Wasps on the opening day of the season but Nick Evans's missed penalties proved costly.
A Tom Varndell interception and Christian Wade try put Wasps 14-0 ahead but Matt Hooper's lucky bounce saw the deficit reduced to 14-13 at half-time.
The home side pressed after the break but, after an exchange of penalties, Evans missed a late chance to steal it.
Had he kicked over the penalty with two minutes to go, it would almost certainly have extended Quins' winning run to 11 matches.
But Wasps snatched their second away win of the season - and first at the Stoop in six years, to move back into the Premiership top four.
They were ahead in the seventh minute when Varndell intercepted Evans's pass and streaked clear to run in under the posts for his 50th try for the club.
Evans missed a straightforward penalty soon after and Wasps doubled their advantage in the 14th minute with a fine counter-attacking move was finished by Wade.
Harlequins finally got themselves on the scoresheet four minutes later after centre Chris Bell had been sent to the sin-bin for a high tackle on Nick Easter.
And Hopper added Quins' first try when Wasps full-back Hugo Southwell failed to mop up his kick.
Evans trimmed the gap to 14-13 with another penalty to set up a thrilling second half.
Quins pressed but Wasps scored next, with Nicky Robinson kicking three points after an infringement from flanker Luke Wallace.
Evans reduced the deficit back with a penalty but missed his next effort to clinch the win.