Glasgow, who went into the game fifth in the table, claimed a sixth win in succession over the Ospreys thanks to a 77th-minute unconverted try by winger Tommy Seymour plus two penalties from Duncan Weir.
By contrast this was a blow for the Welsh side who had put in a lot of hard work on the night.
They had led 3-0 at the turn thanks to a penalty from Dan Biggar who produced a second-half effort and a drop goal after 73 minutes that seemed to have won the game before Seymour crossed over minutes later.
With the strong and bitter wind behind them, Ospreys had the better of territory and possession in the opening stages, and that was despite referee John Lacey penalising them three times at the tackle situation.
Glasgow seemed to be parked in the visitors' 22 and they too lost out to a penalty, at a scrum.
In the 19th minute a flowing piece of Ospreys possession came to an end when Glasgow lock Leone Nakarawa was penalised as he tackled Rhys Webb at a ruck and Biggar kicked the straight-forward penalty.
Around the half-hour mark, just when the home side seemed at last to be building some pressure, winger Nikola Matawalu put his side under pressure, knocking on a quickly taken lineout throw from Peter Murchie deep in his own half.
However his blushes were spared when the Glasgow pack won a penalty at the scrum.
Neither side was able to drive home an advantage. Typically in the 38th minute Biggar's little chip set up an Ospreys' lineout 10 metres from the home line - only for the Welshmen to be penalised when they tried to set up the post lineout drive.
Warriors took the initiative from the restart and after 48 minutes, a penalty kicked by Weir brought them level.
The award followed drives, first by centre Alex Dunbar and then hooker sub Doug Hall.
Ospreys' first visit of the half to the home 22 ended with them losing their own lineout as the game approached the hour mark, when they were penalised for holding on on their 10-metre line, Weir kicked the penalty to put Glasgow ahead.
The visitors' long injury list looked to get even longer when scrum-half Rhys Webb was helped off with a nasty looking leg injury.
With 15 minutes left, Justin Tipuric found space off a lineout in the home 22 and the move ended with Glasgow caught offside and Biggar's penalty restoring equality.
Glasgow got back on the attack until 73 minutes in, when an Ospreys break out saw centre Hanno Dirksen reach the Glasgow half and the position was manoeuvred for Biggar to drop a goal.
However, in an exciting climax to an otherwise forgetable game a try by winger Seymour - after confirmation from the television official - won it for Glasgow.
He reached a cross kick after Nikola Matawalu had broken the Ospreys' line. Weir's conversion hit a post.
Then a 'try' by Glasgow centre Finn Russell was ruled out after TV evidence and there was still time for Ospreys to manoeuvre a drop goal attempt for Biggar - only for Matawalu to charge it down deep into stoppage time.