Edinburgh (8) 21
Tries: McKenzie, Talei. Con: Paterson. Pens: Paterson 2. Drop goal: D Blair
Ulster (10) 16
Tries: Whitten. Cons: Wallace. Pen: Wallace 2, Humphreys.
Fraser MacKenzie scored his first try for Edinburgh in the win over Ulster
Tries by Fraser McKenzie and Netani Talei helped Edinburgh beat Ulster in the Magners League at Murrayfield.
McKenzie's first try for the home team was cancelled out by Ulster inside centre Ian Whitten's run over the line and the visitors led 10-8 at the break.
But Edinburgh turned things around, with a monstrous run by Talei halted a metre from the line before he was able to force his way over.
Two Ulster penalties made it close but David Blair's drop goal sealed the win.
For Rob Moffat's side the result was revenge for the 29-21 at Ravenhill in September and a relief after two recent narrow defeats by Northampton and Blues in the Heineken Cup.
Paddy Wallace missed an early penalty for the visitors before Edinburgh moved into the lead when 22-year-old McKenzie forced his way through the Ulster defence.
Chris Paterson, captain for the night in the absence of rested Roddy Grant, missed a tricky conversion from 35m.
When Edinburgh were next penalised, the boot of fly-half Wallace got Ulster off and running to make the score 5-3.
Paterson thumped a kick between the posts to score a penalty for Edinburgh as the rain tumbled down, yet the home fans were silenced when in the 29th minute Ulster worked the ball from right to left for Whitten to finish off a flowing move.
Wallace kicked the conversion to put the Belfast side in front for the first time in the match.
Ulster scored with another penalty before powerhouse Talei started and finished a move to run over and give Edinburgh a 15-13 lead before full-back Paterson's conversion.
The same player did not disappoint when presented with another penalty midway through the second half, but a further penalty from 40m wide on the left sailed across its target.
Ulster knew there was time yet to win the match and when replacement Humphreys confidently kicked a penalty to make it 18-16 the final stages were tense.
David Blair's skilful drop goal confirmed the result for Edinburgh.
Ulster coach Brian McLaughlin:
"In the first half we didn't turn our possession into points and again we paid the consequences.
"We've got to look at it and say it's not acceptable, not good enough.
"Okay, we got a point but we really should have got the victory tonight.
"Rory Best went off and we lost our composure and this group of players has got to take a big look at themselves and realise that we can't stop playing."
Edinburgh: Paterson, Thompson, Cairns, King, Visser, D Blair, Laidlaw, Jacobsen, Kelly, G. Cross, MacLeod, McKenzie, MacDonald, Rennie, Talei.
Replacements: Gillies, Traynor, Young, Gilchrist, Newlands, M Blair, Grove, Robertson.
Ulster: D'Arcy, McCrea, Trimble, I. Whitten, Mcllwaine, Wallace, Pienaar, McAllister, Best, Botha, Muller, Tuohy, Ferris, Henry, Diack.
Replacements: Kyriacou, Court, Young, Caldwell, Wannenburg, Marshall, Humphreys, Spence.
Referee: James Jones (WRFU)