Ulster moved up to second in the Celtic League after beating their title rivals at Murrayfield on Friday night.
Edinburgh (6) 23
Tries: Penalty try, Hodge
Con: Hodge 2
Pens: Hodge 3
Ulster (16) 31
Tries: Maxwell 2, Boss
Con: Humphreys 2
Pens: Humphreys 4
Andy Maxwell's try put Ulster ahead before Issac Boss went over to help Ulster to a 17-6 lead at the break.
Edinburgh pressed after Ulster captain Simon Best was sin-binned and they were rewarded with a penalty try.
Maxwell scored his second try before receiving a yellow card but 13-man Ulster had done enough despite Duncan Hodge's injury-time touchdown.
Edinburgh applied the early pressure but failed to capitalise and it was Ulster who struck first.
Humphreys charged down Rory Lawson's kick and he passed to Stephen Ferris, who off-loaded for Maxwell to run in a converted 10th minute try.
Humphreys stretched the lead with a penalty before the Gunners hit back with a brace of penalties from Duncan Hodge.
Edinburgh number eight Dave Callum was sin-binned on 36 minutes for trying to slow the ball down.
The visitors scored their second try three minutes later with scrum-half Boss getting the final touch after the Ulster forwards drove over from a scrum.
A Hodge penalty was sandwiched between two from Humphreys at the start of the second half.
Ulster captain Simon Best received a yellow card for use of the boot and immediately the Scots went on the offensive.
The pressure resulted in a converted penalty try on 70 minutes with Ulster punished for trying to pull a maul down.
But Maxwell restored Ulster's grip on the game three minutes later, the wing getting to the end of a Paul Steinmetz chip before touching down.
Maxwell was sent to the sin-bin in the 78th minute but Ulster, despite being down to 13 players, went on to claim the next score with a Humphreys penalty.
Hodge sprinted over for an injury-time try but it was all in vain for a defeated Edinburgh.
Edinburgh: Leonelli Morey, Webster, Godman, Dey, Pyke, Hodge,
Lawson, Jacobsen, Kelly, Dickinson, Strokosch, Duley, Mustchin,
Replacements: De Luca for Dey (60), Jorgensen for Pyke (60),
Hall for Kelly (49), Smith for Dickinson (36),
Pringle for Strokosch (74), MacDonald for Cross (55).
Not Used: Monro.
Ulster: Cunningham, Topping, Trimble, Steinmetz, Maxwell,
Humphreys, Boss, B. Young, R. Best, S. Best, Harrison,
McCullough, N. Best, Ferris, Wilson.
Replacements: Bell for Topping (55), Campbell for Boss (74),
J. Fitzpatrick for B. Young (55), Brady for R. Best (74),
Frost for McCullough (74), McMillan for Ferris (60).
Not Used: Larkin.
Referee: Nigel Whitehouse (WRU).