Duncan Weir also kicked 23 of Glasgow's points as Sean Lineen's men inflicted a first league defeat of the season on the Ospreys, and Gray relished his role as try-scoring hero.
"The first half started well enough but they came back at us and put us under pressure," he said.
"Sean highlighted at half-time that we had to be a lot better in the contact and the boys came out in the second half, fronted up and we managed to pull away.
"It was a cracking break and we were pounding away and I was lucky enough to get on the end of it.
"There's nothing better than getting back out there after the World Cup, you just want to go out there and prove yourself."
Despite their first defeat of the season, Ospreys remain top of the table but that was scant consolation for head coach Sean Holley.
He said: "We started off well and looked in good shape, deservedly getting on top on the scoreboard. We had two or three opportunities to put the game to bed even in that first half, but we didn't take them.
"Despite that though, we were in a good position at half-time and were pretty positive. The message at the break was to build possession and territory but we failed to do that, we didn't get enough time in their 22 to do anything.
"We became ill-disciplined and that handed momentum to Glasgow. We got what we deserved in the end and it was very disappointing.
"We've got some big games around the corner now that we need to focus on and work towards. If we show the right attitude and approach the coming weeks properly then this will prove to be just a blip."