Quins were cruising at the break as scores from Andre Esterhuizen, Marcus Smith and Cadan Murley replied to Scott Cummings' early effort.
Glasgow dominated the first half hour of the second half with tries from Johnny Matthews and ever-present George Horne levelling the contest, before Horne's penalty took Warriors ahead.
But replacement hooker Riley took his chance from the back of a maul on 76 minutes to send Quins into a Champions Cup quar ter-final for the first time in 11 years.
"Whenever we're ahead, we seem to let the opposition in," said star man Smith. "That's something we're working on. We're still not where we want to be, but we've got another European knockout now, which is exciting.
"In the last two years we've fallen at this hurdle, so that's a monkey off the back."
This story is from the {{IssueName}} edition of {{MagazineName}}.
Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 9,000+ magazines and newspapers.
Already a subscriber ? Sign In
This story is from the {{IssueName}} edition of {{MagazineName}}.
Start your 7-day Magzter GOLD free trial to access thousands of curated premium stories, and 9,000+ magazines and newspapers.
Already a subscriber? Sign In
Vermeulen excited to visit old friends
EXETER start their Champions Cup campaign away in South Africa on Saturday, but Jacques Vermeulen will feel very much at home.
Scotland deserve fair share of Lions
WE MAY be exaggerating here, but not by much: since the wonderful Tom Smith made the last of his half-dozen consecutive international appearances in the red jersey of his dreams, as opposed to the blue one, it has been easier to spot a Twickenham chief executive in a food bank than clap eyes on a Test Lion from Scotland.
We'll be locked and loaded for Sale trip - Cheika
WITH wins over Exeter, Newcastle and Saracens, playing away from home in the Premiership currently holds no fears for Leicester.
Sanderson: We need to get our bite back
ALEX Sanderson expects Sale to bear their teeth against resurgent Leicester at the AJ Bell Stadium after heavy defeats on the road in the last two rounds.
Newcastle master misfiring Saracens
STEVE Diamond pledged that Newcastle had to focus on home form and turn Kingston Park into a fortress, and those words came to fruition in a season-defining victory against Saracens.
Lam puts Ibitoye in frame for England
PAT Lam believes Steve Borthwick should put Gabriel Ibitoye in his future England plans and give the wing a Six Nations run out.
Carreras class has Saints on the rack
GLOUCESTER'S first-half charge won this classy Premiership contest despite a Northampton fight-back led by fit-again No.9 Alex Mitchell.
Chiefs fight hard but Bath go back to top
THIS was a rare ugly match in the Premiership as Bath returned to the top of the table and Exeter’s losing run stretched to seven league matches.
Pepper praise for Underhill
SAM Underhill was one of Guy Pepper’s idols growing up and he’s now enjoying learning from him in person at Bath.
We can't compete with the big dogs, admits Diamond
STEVE Diamond will be putting young players on long-term contracts to protect Newcastle from the greater spending power of every other club in the Premiership.