Skipper Robbie Diack was also on the scoresheet along with lively scrum-half Paul Marshall and his half-back partner James McKinney, who also produced a flawless kicking performance to land seven kicks from seven.
The visitors landed two late scores through Greig Tonks and Grayson Hart to back up the opening try by Cornell du Preez.
Edinburgh took a deserved lead in the 12th minute when right-winger Dougie Fife broke through Michael Allen’s tackle to set No 8 du Preez racing in at the corner.
The visitors then lost international flanker Iain Henderson to injury, while Ulster winger Allen followed him off after receiving a bang to the head in the lead-up to the try.
Fly-half McKinney, making his first start this season, got Ulster on the board in the 15th minute with a penalty.
The home side finally started to go through the phases and were rewarded when Gilroy scored in the left-hand corner after collecting a long floated pass from Darren Cave. McKinney exquisitely converted from the touchline.
Ulster’s second try came in the 33rd minute with Cave making the ground for Marshall to score, with the help of the TMO.
McKinney added a penalty on the stroke of half-time to leave Ulster sitting comfortably with a 20-5 lead.
Edinburgh came out of the blocks quickly in the second half but Ulster weathered the storm and when Edinburgh’s Springbok lock Izak van der Westhuizen was yellow-carded in the 59th minute, Diack crashed over before Gilroy ensured the bonus point and McKinney added the fifth try.
McKinney’s expert kicking ensured Edinburgh’s late scores could not take the shine of the result.
Scorers for Ulster scorers: Tries: Gilroy 2, Marshall, Diack, McKinney. Pens: McKinney 2. Cons: McKinney 5.
Scorers for Edinburgh: Tries: D Preez, Tonks, Hart. Con: Leonard.
ULSTER: C Gilroy; A Trimble, D Cave (P Marshall, 75), L Marshall (Nelson 66), M Allen (Andrew 22), J McKinney, P Marshall (Shanahan 68); C Black (Court 58), R Herring, J Afoa (Lutton 66) L Stevenson (McComish, 47), I Henderson (Tuohy 15), R Diack (capt), S Doyle, R Wilson.
EDINBURGH: G Tonks; D Fife, J Dominguez, B Atiga, J Cuthbert (Brown 66), H Leonard, S Hidalgo-Clyne (Hart 66); W Blaauw, A Lutui, WP Nel, O Atkins, I van der Westhuizen, T Leonardi (Rennie, 40), R Grant (capt), C Du Preez.
Referee: Neil Hennessy (WRU).