In difficult conditions Quins, who have won their last 10 matches in all competitions, were indebted to centre Matt Hopper for scoring the only try of the contest while Ben Botica kicked 11 points.
Man of the match Tom Guest proved a thorn in the Ospreys side throughout the match with his sniping runs, and he was at it right from the start getting Quins close to a try in the first five minutes.
At the other end, Ospreys fly-half Matthew Morgan showed his pace in a break from halfway before he ran out of room close to the left corner. It was Morgan who broke the early deadlock with an eighth-minute penalty, but Harlequins, who had the lions' share of possession in the opening 40 minutes, responded by putting it through the hands before Botica was held up over the line.
That pressure eventually earned the London team a penalty which Botica converted to square the scores at 3-3 on 13 minutes. Botica was on target again in the 16th minute after the Ospreys were penalised for collapsing a scrum.
It looked as if Harlequins were going to score the first try when wing Sam Smith kicked a ball over the line, but he ran out of room in a small dead ball area. In the end that did not matter because Hopper stretched over the line after good work by Guest. Botica added the extras as Quins led 13-3 on the half-hour mark.
A good scrum earned the Ospreys a penalty which Morgan converted from 40 metres out to cut the Quins lead to seven points. And some more good work going through the phases in the Quins 22 saw them get another penalty, which Morgan kicked in the final minute of the half.
The Aviva Premiership leaders stoked up the pressure at the start of the second half but they could not follow up the good work of a break by Hopper and a decent drive from the line-out.
Ospreys did not have the best of territory but they won a penalty from a scrum after 55 minutes, allowing Morgan to convert his fourth kick to cut the visitors' lead to a single point. Despite their domination in the LV= Cup, Quins made heavy work in their attempt to put the game to bed as conditions worsened at the Brewery Field.
Nine minutes from time, Quins earned a penalty from 30 metres out but Botica was wide of the mark - his first miss in the competition this season. Three minutes from time Morgan had a shot to win the game but it was against the wind, and his 45-metre effort fell well short. If Morgan had scored it would have meant Quins would have had to visit Saracens in the last four.