Connacht's eight-match unbeaten home record this season was ended by Edinburgh who triumphed 16-13 in very wet conditions at the Sportsground.
With the elements behind them, Connacht needed to be further ahead than 13-7 at half-time. A 37th-minute penalty try - straight after Ben Toolis' yellow card - cancelled out David Denton's earlier try, with Miah Nikora kicking the rest of the hosts' points.
Two penalties from Sam Hidalgo-Clyne erased Connacht's lead by the 49th minute and the Edinburgh scrum-half slotted the match-winning penalty with 10 minutes left, while Connacht's Finlay Bealham was in the sin-bin.
It was Edinburgh's first away victory in the Guinness PRO12 since the opening round in September, and puts them back within reach of the top six.
It was Edinburgh who opened the scoring 16 minutes in.
A slashing break from Dougie Fife brought the Scots right up to the try-line and Denton burrowed over from close range. Hidalgo-Clyne added the conversion.
Connacht replied within seven minutes, Nikora nailing a left-sided penalty after a half-break from Bundee Aki and they were quick to capitalise on the sin-binning of Toolis four minutes before the break.
The second-rower was penalised for not rolling away after a Rodney Ah You charge and the resulting penalty saw Connacht dominate a five-metre scrum to earn a penalty try which Nikora converted. The New Zealander also tagged on a penalty with the last kick of the half.
However, the visitors opened the second half with two well-struck Hidalgo-Clyne kicks.
He then missed a difficult penalty attempt from the left but the defensive duties for Connacht were taxing.
With replacement prop Bealham sin-binned for not rolling away, Hidalgo-Clyne drove over a penalty from distance under intense pressure. It proved to be the decisive score as the Scots contained Connacht to the finish.