It is the second week running that South African Pienaar has secured a last-gasp win for Ulster, after his drop goal heroics against the Dragons last time out.
Scotland's Ruaridh Jackson booted 11 points on his return from Six Nations duty, while his replacement Duncan Weir set up a tight finish with a late penalty.
The hosts held the upper hand in the opening exchanges, an early Jackson up-and-under causing havoc in the Ulster ranks.
From the ensuing pressure, the Glasgow out-half notched the game's first points, converting a straightforward penalty after Pedrie Wannenburg was penalised for a tackle offence.
Parity was restored in the 13th minute when Ulster out-half Pienaar slotted a 40-metre penalty which was awarded after a front row infringement in the scrum.
Moments earlier, he had failed with a more challenging attempt from the touchline after Glasgow prop Moray Low had been penalised for a cynical block on his Scotland colleague Simon Danielli.
Low's front row colleague Jon Welsh created the first try-scoring opportunity, with a grubber kick to the corner only just eluding Canada flyer DTH van der Merwe.
Having gone so close to the opening try, the Warriors swiftly shot themselves in the foot, referee David Jones detecting yet another offence in the front row and presenting Pienaar with a simple penalty chance which he stroked over.
The half closed with the Warriors once again on top but they were made to pay when Jackson overcooked a touchline kick and Pienaar thumped over a monster penalty from inside his own half to stretch the Ulster advantage to 9-3.
Jackson was heavily involved in the early stages of the second period, two early penalty misses denting his side's aspirations even as his thrusting running maintained their dominant field position.
In the 49th minute, Jones awarded a scrum penalty in favour of the home side, and this time Jackson made no mistake from straight in front of the uprights.
The Ulstermen's defence was eventually breached when towering lock Aly Muldowney crashed through a lineout to charge down scrum half Paul Marshall's kick.
Muldowney showed great awareness to scoop the loose ball back to the onrushing Grant, who powered over from close range. Jackson added the extras.
Straight from the restart further indiscipline handed Pienaar an opportunity to restore his side's lead, but his penalty attempt drifted wide.
Returning Ireland hooker Rory Best was introduced for the final half hour, but his stay was short-lived as he was ordered to the sin-bin for an 63rd minute indiscretion at a ruck. Jackson converted the resulting penalty for a 16-9 scoreline.
Pienaar atoned for his earlier misses with the boot in emphatic style to level the sides. With the game entering the final 10 minutes, he scrambled over for a seven-pointer which needed confirmation from television match official Iain Ramage.
And level was how it remained until the dying moments. Pienaar appeared to have secured the victory with a sweetly-struck penalty from halfway but Weir knocked over a long range effort to set up a tense finale.
It was left to Pienaar to have the final say, after backchat among the Glasgow ranks moved a long range penalty into the South African's kicking range and he duly added the clinching three points.
|Glasgow Warriors Score Card|
|Ulster Rugby Score Card|