Dave Ewers' try with five minutes left saw second-placed Exeter overturn a 13-point second-half deficit to beat third-placed Harlequins at Sandy Park.
Having almost conceded twice early on, Quins went ahead through Danny Care's 13th-minute try before Stu Townsend levelled eight minutes later.
Scott Baldwin's try and a Marcus Smith penalty saw Harlequins' lead grow to 20-7 before a Harry Williams try.
And after sustained pressure on the Quins line Ewers went over for the win.
The visitors almost crossed replied with a try of their own in the final minute after a line break by Smith, but Ewers forced a turnover on Exeter's own five-metre line to ensure victory.
Defending champions Exeter consolidate second place in the Premiership and are now five points clear of Harlequins, who earned a losing bonus point. Quins are two points clear of fourth-placed Sale, who visit Northampton on Saturday.
But for two fine last-ditch tackles, Exeter could have scored two tries from excellent line breaks in the first 10 minutes, as Joe Simmonds and the ever-dangerous Tom O'Flaherty were hauled down close to the line by Smith and Care respectively.
Both sides struggled to keep hold of the ball in wet conditions, but it was former England scrum-half Care who struck first. The 34-year-old went over unopposed for his 65th Premiership try after quick hands in the forwards released Alex Dombrandt with Care on his shoulder for the offload.
Townsend scored from close range after a well-worked line-out routine by Exeter, before 22-year-old Smith kicked his first penalty for Quins on his 100th appearance to give the visitors a 10-7 lead at the break.
Harlequins went further ahead five minutes after the restart when Baldwin was forced over from a five-metre line-out.
They then crucially saw a Ben Tapuai try ruled out for a knock on in the build-up before Smith went on to land a second penalty to make it 20-7 with 25 minutes left.
A quick tap penalty by Townsend gave Exeter the position for Williams to get his first try of the season and the Chiefs could have gone further ahead 12 minutes from time when Ewers broke through, but James Chisholm did well to turn the ball over close to his line.
But following a five-metre line-out Exeter stretched the field, and after a number of phases on the Quins line, Ewers was on hand to go over to secure a key win over a play-off rival.
Exeter forwards coach Rob Hunter:
"We showed a lot of character to come through the game, especially when we went two scores behind, and it was a tough test for us.
"We made a lot of mistakes, and our ability to move on and do the next thing well is usually pretty good, but at the moment we are dwelling on those mistakes a little while and you can see it in our body language.
"We are getting a little bit frustrated because maybe we are not hitting the heights that we know we can and that can be positive pressure and we have got to make sure we get on top of that a little bit and move on quickly from mistakes."
Harlequins general manager Billy Millard:
"In the second half we just leaked a couple more penalties and a couple more turnovers, and gave them some ball to kick to the corner, and they are pretty clinical when they get those opportunities.
"I thought our defence created a lot of turnovers and we were pretty clean on the penalty count. We just creaked over that a little bit in the second half and gave them a couple of opportunities to get into their driving line-out.
"We came down here pretty confident about what we needed to execute, and we played well and we did a lot of good things.
"It is important now that we reflect and keep driving forward. Playing the European champions is always a good challenge and I think we will get confidence out of it."
Exeter Chiefs: Cordero; Cuthbert, Whitten, Hendrickson, O'Flaherty; J Simmonds (capt), Townsend; Hepburn, Innard, Williams, Kirsten, S Skinner, Ewers, Vermeulen, S Simmonds.
Replacements: Taione, Moon, Street, Lonsdale, Capstick, Hidalgo-Clyne, H Skinner, Devoto.
Harlequins: Brown; Green, Marchant, Tapuai, Murley; Smith, Care; Marler, Baldwin, Louw, Symons, Lewies, Chisholm, Evans, Dombrandt.
Replacements: Gray, Garcia Botta, Collier, Young, Lawday, Landajo, Herron, Northmore.
Referee: Craig Maxwell-Keys.