England legend Jason Leonard lifted the Parker Pen Challenge Cup on his final Harlequins appearance after Montferrand pressed the self-destruct button at the Madejski Stadium.
Quins secured their place in next season's European Cup through a sensational try deep into injury time by substitute Simon Keogh, which his fellow replacement Andy Dunne converted to spark scenes of wild celebration.
Quins were outplayed for much of the match, but Montferrand had centre Raphael Chanal sent off in the 78th minute and the 14 men he left behind could not hang on.
Full-back Gavin Duffy scored a first-half try for the Londoners, while fly-half Paul Burke kicked four penalties and Dunne also slotted a penalty.
Montferrand, whose European Cup hopes disappeared with defeat, claimed touchdowns from man of the match Olivier Azam and scrum-half Pierre Mignoni.
Full-back Anthony Floch booted 13 points and fly-half Gerald Merceron dropped a goal, but it will remain a mystery how Montferrand contrived to lose a game they so clearly dominated.
The lead changed hands on several occasions, keeping a 13,000-plus crowd enthralled, yet Quins struck when it mattered most, capitalising on space out wide created by the reckless Chanal's departure.
And it gave Leonard, rugby's world record cap holder, a glorious send-off after he went on as a substitute seven minutes from time.
The 2017 RBS 6 Nations was watched by record numbers of fans
29 March 2017, 12:25pm
After an enthralling RBS 6 Nations Championship of twists, turns, and no small amount of drama on the last day, figures show the RBS 6 Nations is going from strength to strength, year on year, with no sign of slowing down.