Lee Jones’ early try gave Warriors a 5-3 lead at the break, but Callum Black’s 53rd-minute try and a solid display by replacement Paddy Jackson lifted Ulster above leaders Connacht once more.
Defending champions Warriors, who had Ryan Wilson sin-binned late on, had plenty of territory, but coughed up silly penalties time and time again and the wait for their first league win since November goes on. They clinched a losing bonus point in added time when Taqele Naiyaravoro scored, but Ulster were value for the win.
In his first start, Gregor Hunter sent Sam Johnson through a hole in the Ulster cover and, after good hands by Glenn Bryce and Peter Murchie, Jones finished in the corner.
It took until the 23rd minute for Ulster to get on the board, when Pienaar kicked a penalty after Pat MacArthur was caught offside but Warriors held a 5-3 lead at the break after some outstanding concentration in defence and domination at the breakdown.
The loss of Pienaar to a head injury after half an hour was a blow to Ulster but Glasgow also lost MacArthur and Simone Favaro before half-time to injury.
Jackson was introduced at half-time for Sam Windsor and Hunter was wide of the mark in the 49th minute after some good work by Leone Nakarawa earned the penalty. Warriors attacked but ill-discipline cost them good attacking platforms. Ulster made the most of it. Gilroy sprung the Warriors’ defence and brought Ulster deep into the 22. Black powered over and Jackson converted.