Duncan Weir showed he was more than a match for Ospreys' Matthew Morgan putting in a near-perfect performance with the boot kicking 23 points to the diminutive fly-half's 12.
Morgan made sure the visitors had the final say with a try in the dying seconds but it was a scant consolation as Richard Hibbard's second-half sin-binning proved costly for the Welsh region.
The Warriors started like a house on fire and deservedly took the lead through the boot of Weir after a minute only for Morgan to reply with two penalties of his own in quick succession.
The 19-year-old repeated the trick for another three points after 17 minutes and his fourth just after the half hour mark topped the lot as he slotted an effort from well inside his own half.
But the Warriors had the last laugh of the first half, Weir kicking an easy penalty right in front of the posts to make it 12-6 moments after striking the post from far wide out on the left.
Like the first half, Glasgow started the second strongly and were rewarded for their efforts when Weir kicked his third penalty of the evening to reduce the deficit to three points.
Ospreys regained a foothold but couldn't add to their tally as Morgan missed a drop goal and Weir pulled Glasgow level with another three points with 57 minutes on the clock.
Their cause was boosted when Ospreys hooker Hibbard was given a yellow card for coming in from the side in the 60th minute - with the Warriors immediately setting about the try line.
After a succession of phases Gray used all of his giant frame to stretch over the whitewash out wide and Weir converted via the post to take the score to 19-12.
Weir booted three further penalties to make sure of the win and cap a fine night personally with Morgan's late burst to score a scant consolation.
|Glasgow Warriors Score Card|
|Ospreys Score Card|