The teenage winger's first put the visitors in front after they had trailed to an early Tobie Botes penalty, and he went over again in the fifth minute of the second half to put them firmly in control at 19-6 up.
In between times, Scotland international Simon Danielli also touched down for Ulster, who moved above the Scarlets and into second in the standings.
It was the Italians who drew first blood, though, Botes slotting over a sixth minute penalty before missing a chance to double that lead in the 16th minute.
Treviso had started well and should have added to their lead after Ian Humphreys' clearance kick had been charged down. But his half-back partner Paul Marshall reacted quickly to rescue the situation and Botes' subsequent penalty was badly hooked.
Humphreys redeemed himself by launching a well-weighted kick to the corner which the pacy Gilroy gobbled up to score the game's opening try, 21 minutes in. Lock Tim Barker deserves credit too for his midfield burst in the build-up to the try.
Humphreys converted and while Botes replied with a superbly-struck penalty from the 10-metre line, Ulster were able to add a second try in the 33rd minute to move 14-6 ahead for half-time.
The try came from a kick downfield from scrum half Marshall. Danielli used his strength to gather in possession and he set off for the line, dashing away from the cover to finish off an opportunist score. Humphreys' successful conversion put eight points between the sides.
Botes missed another penalty before the break and Ulster were first out of the blocks in the second half, Humphreys probing again with the boot. His kick was almost gathered by the advancing Paddy Wallace as the Treviso line was threatened in the opening minutes.
But just moments later, after some good lineout work by Pedrie Wannenburg and Barker, a clever kick from Humphreys unlocked the hosts' defence again and the 19-year-old Gilroy hared onto the ball to notch his fourth try in two games.
Humphreys' conversion attempt knocked off the left-hand upright and as they hunted for the bonus point try, Ulster had a near miss when full-back Adam D'Arcy had an effort ruled out by television match official Mauro Dordolo.
Treviso raised their game coming up to the hour mark, with their forwards grinding their way deep into Ulster territory. Botes landed his third penalty after Ulster flanker Willie Faloon was yellow carded for not rolling away after a tackle.
Infringements from replacement prop Paddy McAllister and Wannenburg set up another shot at the posts for Botes, but his effort missed the target and Ulster withstood some late pressure to gain a confidence-boosting win.
|Benetton Treviso Score Card|
|Ulster Rugby Score Card|