Harlequins, needing a bonus point to qualify by knocking their opponents off the top of Pool C, failed to take advantage of their temporary numerical superiority in this group decider.
Ospreys, with Gavin Henson scoring all of their 19 points, join English clubs Leicester, Saracens and Wasps in the semi-final double-header at Cardiff's Millennium Stadium on Saturday March 22nd.
Henson's haul consisted of four penalties, an opportunist injury-time try - when he sliced through the home defence - and the resulting conversion. Quins replied with a first-half penalty from fly half Adrian Jarvis and an unconverted second-half try from their South African centre De Wet Barry.
Referee Huw Watkins brandished his yellow card three times in the space of 10 minutes towards the end of the first half. Prop Paul James was first to go on the half hour after pulling down a maul, Wales fullback Lee Byrne followed four minutes later for spear-tackling his Harlequins opposite number Mike Brown after he collected a high kick from Jarvis and he was then followed by Henson.
Quins were controversially denied two tries after the fourth official decided the ball had not been grounded when Harlequins drove the Ospreys pack back over their own line.
However, more contentious was when the hosts were denied a penalty try with Wales centre Sonny Parker fortunate not to join his teammates in the bin after he pulled back Harlequins' flanker Chris Robshaw as he chased a chip through from Jarvis.
The fourth official was called to adjudicate once again as Robshaw and Barry both got within a fingertip of the loose ball but he decided there was no score. Quins had also benefited from an earlier video decision which ruled Ospreys had failed to ground the ball after their forwards drove flanker Marty Holah over.
The delays for the video decision meant that, with 40 minutes on the clock, Ospreys were down to 12 players when Henson was sin-binned for taking out David Strettle with a blatant body check as the England three-quarter chased a kick.
But a combination of some desperate defending, allied to the decisions of the officials, meant Ospreys survived to half-time without conceding a single point with their reduced numbers.
With Henson still off, Harlequins finally crossed in the 48th minute when Barry won the chase to pounce on a through-kick from Jarvis. But Henson returned to put his side back in front three minutes later with his third superbly-struck penalty.
He finally missed with his fourth attempt in the 62nd minute but had the final say by stretching his side's lead with a late penalty and a runaway try and conversion in injury time.
target=_blank>Click Here for a Statistical Match Report from the Harlequins v Ospreys EDF Energy Cup clash