United Rugby Championship: Edinburgh v Connacht
Edinburgh: (7) 25
Tries: Goosen, Vellacott, Bennett Pens: Healy Cons: Healy 2 Drop-goal: Healy
Connacht: (3) 22
Tries: O'Halloran, Joyce, Prendergast Pens: Carty Cons: Carty, Hanrahan
Ben Healy's drop-goal with the final play of the game gave Edinburgh a thrilling win that ends Connacht's 100% record at the start of the United Rugby Championship.
Wes Goosen's early try and Ben Vellacott's after the break put Edinburgh in control.
But Connacht replied through Tiernan O'Halloran and Joe Joyce - and, although Mark Bennett touched down for the hosts, Cian Prendergast's try had the scores level with only two minutes left only for Healy to strike gold.
Edinburgh, who move up to seventh in the table with Connacht down to fourth, started with determination to put behind them their late capitulation away to Leinster last week.
Charlie Shiel and Bennett combined before the former released wing Goosen outside him to score in the corner, with Healy adding the extras from out wide.
When Blair Kinghorn had a kick charged down, prop Javan Sebastian picked up in an offside position and Jack Carty reduced the arrears with the resulting penalty.
Healy missed a long penalty attempt - his first miss in an Edinburgh shirt - but the hosts broke through with their next attack.
Kinghorn gathered a long punt, released Duhan van der Merwe and his fellow Scotland international left a couple of opponents in his wake as he raced down the wing before releasing Vellacott to cross near the posts with the scrum-half's first touch off the bench, with Healy adding the easy conversion.
Connacht came from 17 points down to beat Ulster last week and it looked like they might stage another comeback when full-back O'Halloran crashed over after a maul on the home try line and prop Pierre Schoeman marked his 100th Edinburgh appearance by being sin-binned for a high challenge in the build-up.
Carty's conversion reduced the arrears to four points and looked like it might prove a turning point, but the gap stretched almost immediately when the 14 men were presented with a penalty that Healy slotted with ease.
Connacht did make their man advantage count, though, and it was Joyce's turn to make an impact as a replacement when the lock held off two challenges to power over the line.
Carty's missed conversion came just as Schoeman returned to the fray and proved crucial.
A quick tap by Vellacott caught Connacht unawares as they wondered whether Edinburgh might settle for a penalty in front of the posts and the scrum-half's sweeping pass set up Bennett for Edinburgh's third try.
Connacht were not finished yet. Prendergast went over after the visitors laid assault on the Edinburgh try line and, when JJ Hanrahan converted to level with two minutes remaining, it looked like a point had been rescued.
However, Edinburgh went straight up the other end and, with a penalty in the bank should their attack falter, Healy's boot sent Hive Stadium into raptures.
Edinburgh senior coach Sean Everitt: "I thought we played pretty well tonight. Our defence played really well.
"I enjoy this team's resistance. I'm really proud of the boys and this should give them belief that they can go far in this competition."
Edinburgh: Kinghorn , Goosen, Bennett, Lang, Van der Merwe, Healy, Shiel; Schoeman, Ashman, Sebastian, Young, Gilchrist, Dodd, Boyle, Mata.
Replacements: Cherry, Venter, Williams, Sykes, Muncaster, Vellacott, Dean, McCann.
Connacht: O'Halloran, Porch, Ralston, Daly, Smith, Carty, Blade, Dooley, McElroy, Aungier, N. Murray, D. Murray, Prendergast, Oliver, O'Brien.
Replacements: Tierney-Martin, Duggan, Illo, Joyce, Butler, C Reilly, Hawkshaw, Hanrahan.
Referee: Ben Whitehouse (WRU)
The Fab Four's rise, fall and rebirth...: Told in the band's own words with an extensive archive, the story of how The Beatles shaped music
How was the acclaimed series, Planet Earth, filmed? Sir David Attenborough and film-makers reveal how they captured spectacular moments in nature