As Warriors made a final push with the clock counting down, James Eddie breached the line and Stuart Hogg had the easiest of conversions to secure a rare win for Gregor Townsend's men at Ravenhill.
It was a game Ulster should not have lost. On a night when Ravenhill paid tribute to Nevin Spence, who died a year ago in a farm tragedy along with his father Noel and brother Graham, the home side wasted a glorious opportunity to seal a game which they led 12-6 at half-time.
Instead, Gregor Townsend's men walked away with the four points to remain unbeaten after two games while Ulster had only a losing bonus point - the same they managed from their shock 15-8 defeat at Newport Gwent Dragons the week before.
Indeed, with the Glasgow prop Moray Low sin-binned late on, anything other than an Ulster win seemed inconceivable, but the home side can only blame themselves for their misfortune having blown a host of try-scoring opportunities, with their only scores coming from four Paddy Jackson penalties.
Hogg, playing his first game since the Lions tour, opened the scoring for Warriors in the fifth minute with a penalty after Johann Muller's high tackle on Ruaridh Jackson, but Ulster quickly hit back when Paddy Jackson replied two minutes later.
Paddy Jackson then landed his second three-pointer just before the end of the first quarter after some great offloading from Roger Wilson and Nick Williams and did so again after 20 minutes with a long-range effort.
But Hogg narrowed the gap to 9-6 after Ulster strayed offside four minutes before the half hour. Ulster responded with some eye-catching play from Williams and the impressive Ian Porter and this, in turn, led to Paddy Jackson's fourth penalty which sailed between the posts to take the home side's lead to 12-6.
Then, just at the end of the half, Darren Cave was penalised at the breakdown but Hogg was wide with the effort, much to Ulster's relief.
Ulster upped their tempo in the second half but neither side was able to score, with Michael Allen, Luke Marshall and David McIlwaine all scorning chances to cross for Ulster, with the latter actually managing to get over the line but being held up by a combination of Jonny Gray and Tommy Seymour.
Paddy Jackson's 67th-minute penalty sailed wide as Ulster continued to dominate possession and territory, while Low's sin-binning ensured the Warriors had to dig even deeper so as not to concede any further points.
Even down to 14 men, though, Glasgow resisted and they even had a five-metre scrum in the latter stages only to concede a penalty and allow Ulster to relieve the pressure.
Warriors were not finished and after DTH van der Merwe was hauled down by Iain Henderson, the Warriors stayed in the Ulster 22 and, from a tap penalty, substitute Eddie crashed over with Hogg's conversion sealing the most unlikely of wins.