Wing Gonzalo Camacho’s 76th-minute try, converted by Nick Evans, inched Quins home at Cardiff City Stadium.
Stade looked to have done enough through four Lionel Beauxis penalties and drop-goals from centre Mathieu Bastareaud and full-back Martin Rodriguez.
But Quins conjured a special finish as prop Joe Marler and scrum-half Danny Care completed the hard yards for Camacho to cross and hand Evans his match-winning chance.
A delighted Quins’ director of Rugby, Ireland’s Conor O’Shea said: “We didn’t play well tonight but we’ve been on the end of some heartbreaking defeats this season, so we will take it...lose close games as we have and you begin to doubt yourself.
“But the supporters kept the guys going and I’m just delighted for them and the players.
“We’ve played enough good rugby to earn a big slice of luck.”
Harlequins: Brown; Camacho, Lowe, Turner-Hall, Monye; Evans, Care; Marler, Gray, Johnston, Kohn, Robson, Fa'asavalu, Robshaw (capt), Easter.
Replacements: Skinner (for Fa'asavalu, 60), Chisholm for Lowe (75)
Stade Francais: Rodriguez; Arias, Bastareaud, Bousses, Camara; Beauxis, Dupuy; Roncero, Bonfils, Attoub, Palmer, Pape, Haskell, Burban, Parisse (capt).
Referee: George Clancy (Ireland)