Ulster's unbeaten record in the Magners League came to an end at rain-soaked Murrayfield as David Blair's drop goal put the seal on Edinburgh's 21-16 win.
The Irish visitors had led 10-8 at the break thanks to a try from centre Ian Whitten and five points from the boot of Paddy Wallace. Fraser McKenzie went over for the Gunners with Chris Paterson adding a penalty.
Ulster added two more penalties after the interval, but Netani Talei's converted try, a second penalty from Paterson and that Blair drop goal gave the hosts the four points.
Accurate kicking was hardly the order of the opening minutes, Blair putting the kick off straight out before Wallace missed a straightforward penalty and a Blair drop goal went askew.
Edinburgh kept up the pressure and after 10 minutes, Greig Laidlaw linked with Alan MacDonald to put lock McKenzie over. Paterson missed the conversion and as the rain made the ball increasingly difficult to hold.
Ulster full-back Adam D'Arcy almost unpicked the Edinburgh defence, but a try-saving tackle by Laidlaw kept the home line intact.
That gave Ulster field position for the first time and they got on the board with a Wallace penalty on the quarter-hour mark but Paterson restored the five-point margin with a 40-yard shot.
Ulster flexed their muscles in the pack as Robbie Diack thundered into the heart of the Edinburgh defence and, from the ruck, a lovely offload from lock Dan Tuohy put sent Whitten scampering over for Wallace to convert.
Ulster turned the screw prior to half-time and it took some backs-to-the-wall defending to keep the visitors out as drives by Rory Best, Tuohy and Chris Henry came to nothing.
A Paddy Wallace penalty got the scoreboard shifting after only a couple of minutes of the second half but Edinburgh hit back as number eight Talei, who scored against Northampton in the Heineken Cup last weekend, shredded the Ulster defence but held on a fraction too long with the line open for Tim Visser.
But the big Fijian finished what he had started and crashed over from close range, Paterson converted and Edinburgh started to play a more tactical game but failed to take advantage of some fine kicks from Paterson and Blair which turned the Ulster back three.
On the hour mark, Andy Kyriacou offended and Paterson slotted his second penalty but Ian Humphreys pulled the margin back to two points with a monster kick from the halfway line, giving Ulster a real boost going into the final minutes.
It was nerve jangling stuff until Blair showed his cool and slotted a long-range drop goal which deservedly clinched the points for Edinburgh.
Tries: McKenzie, Talei
Pens: Paterson 2
Drop: D Blair
Pens: Humphreys, Wallace 2
Edinburgh: 15 Chris Paterson (c), 14 Jim Thompson, 13 Ben Cairns, 12 James King, 11 Tim Visser, 10 David Blair, 9 Mike Blair, 7 Ross Rennie, 8 Netani Talei, 6 Alan MacDonald, 5 Fraser McKenzie, 4 Scott MacLeod, 3 Geoff Cross, 2 Andrew Kelly, 1 Allan Jacobsen.
Replacements: 16 Finlay Gillies, 17 Kyle Traynor, 18 David Young, 19 Grant Gilchrist, 20 Scott Newlands, 21 Greig Laidlaw, 22 Alex Grove, 23 Mark Robertson.
Ulster: 15 Adam D'Arcy, 14 Mark McCrea, 13 Andrew Trimble, 12 Ian Whitten, 11 David McIlwaine, 10 Paddy Wallace, 9 Ruan Pienaar, 8 Robbie Diack, 7 Chris Henry, 6 Stephen Ferris, 5 Dan Tuohy, 4 Johann Muller, 3 BJ Botha, 2 Rory Best (c), 1 Paddy McAllister.
Replacements: 16 Andi Kyriacou, 17 Tom Court, 18 Bryan Young, 19 Ryan Caldwell, 20 Pedrie Wannenburg, 21 Paul Marshall, 22 Ian Humphreys, 23 Nevin Spence.
Referee: James Jones (Wales)