James Eddie's last-gasp try gave Glasgow victory at a new-look Ravenhill to leave Ulster with two defeats from their opening two Pro12 games.
Ulster led 12-6 at the end of a scrappy first half, with Paddy Jackson firing over four penalties and two Stuart Hogg penalties keeping Glasgow in touch.
The hosts dominated the second half but wasted a series of chances and Glasgow took advantage in the final minute.
Eddie went over from close range and Hogg added the winning conversion.
There was a minute's applause before the game for Nevin Spence, the Ulster centre who died along with his father and brother in a farm accident a year ago.
It was an error-strewn opening 40 minutes in the first competitive game at the redeveloped Ravenhill, which boasts two new stands with the capacity set to rise to 18,000 when work is completed next year.
Glasgow made a bright start and a Hogg penalty put the Scots ahead after six minutes, but Jackson quickly levelled for the hosts.
Two more Jackson penalties, the second a fine kick from long range, opened up a six-point gap.
Ian Porter's last-ditch tackle denied DTH van der Merwe a try as the Glasgow wing sprinted clear, although Hogg made it 9-6 with a 28th minute penalty.
Jackson fired over his four penalty as he bounced back in style from a disappointing kicking display in last Friday's defeat by the Dragons.
Hogg pulled an injury-time penalty just wide to leave Glasgow trailing by six at the break.
Ulster pressed in the early stages of the second half but were frustrated in their search for an opening try.
Michael Allen had a clear path to the line but dropped the ball from Rob Herring's pass before Luke Marshall missed out on a try by failing to hold on to Jackson's lay-off.
David McIlwaine surged over but determined Glasgow defending prevented the wing touching down.
Jackson sent a penalty wide before Glasgow replacement Murray Low was sin-binned on 68 minutes after deliberately slowing play.
Ulster's wastefulness was punished when Glasgow scored the game's only try with just seconds remaining.
Replacement Eddie surged over from Ruaridh Jackson's clever off-load and Hogg slotted over a simple conversion to win it with the last kick of the game.
Ulster: Payne, McIlwaine, Cave, L Marshall, Allen, Jackson, Porter, Black, Herring, Fitzpatrick, Muller, Tuohy, Wilson, Doyle, Williams.
Replacements: P Marshall for Porter (56), Lutton for Fitzpatrick (56), Henderson for Muller (56), Henry for Doyle (59).
Not used: Annett, Court, McKinney, R Andrew.
Glasgow: Hogg, Seymour, S Lamont, Bennett, van der Merwe, Jackson, Pyrgos, Grant, MacArthur, Kalman, Swinson, Gray, Harley, Holmes, Strauss.
Replacements: Ascarate for S Lamont (54), Cusiter for Pyrgos (62), Reid for Grant (66), Hall for MacArthur (54), Low for Kalman (56), Eddie for Harley (69), Fusaro for Holmes (54), Vernon for Strauss (54).
Ref: Ian Davies (WRFU).