Connacht celebrated their first RaboDirect PRO12 victory since September as they put one over on their former head coach Michael Bradley.
Bradley's Edinburgh side struck for tries through Tim Visser and Chris Paterson, but the Irish province prevailed thanks largely to their tireless forwards and Niall O'Connor's 11-point kicking contribution.
The 4,324-strong crowd at the Sportsground watched the hosts end the first half with a 10-0 advantage, with Tongan international Fetu'u Vainikolo scoring his first league try.
Their lead was whittled down to just three points after Visser and Paterson touched down and replacement Phil Godman added a penalty.
But with John Muldoon in talismanic form, Eric Elwood's men finished the stronger - replacement Matthew Jarvis kicked a penalty and converted Mike McCarthy's last-minute try.
McCarthy's score took the losing bonus point away from the Scots and ensured that Connacht leapfrog over them in the league standings, going from 11th to ninth.
Connacht set the early pace with Tiernan O'Halloran and Kyle Tonetti running well, however Edinburgh recovered from an initial lineout loss to establish decent field position.
Gregor Hunter was unfortunate to miss his first shot at the posts, a neat left-footed penalty which shaved an upright and went wide.
The Scots kept control of possession and territory but lacked the necessary penetration to open the scoring, and O'Connor - whose late penalty earned a draw with Glasgow Warriors - soon kicked Connacht ahead.
The outside-half fired over a long range penalty in the 20th minute. Sean Cox and Netani Talei led the Edinburgh response, gaining some hard yards but Hunter's drop goal attempt was off target.
Penalties blunted both sides' tryscoring attempts until the Connacht scrum, including impressive loosehead Denis Buckley on his first start, shoved the Scots off their own ball.
Frank Murphy led the counter-attack for the hosts, an inside pass from O'Connor keeping the move going and setting up Vainikolo for a scrambled 33rd minute try.
O'Connor converted and Connacht's confidence was clearly on the up with Muldoon ripping the ball free and passing for prop Ronan Loughney to bludgeon forward.
The early stages of the second half told a different story though. Kyle Traynor's 20-metre burst underlined Edinburgh's intentions and only a knock on prevented them from dotting down.
O'Connor increased his influence by kicking the second of two penalty attempts but despite losing Tom Brown to the sin-bin, Edinburgh remained right in the hunt.
Connacht captain Gavin Duffy had a clearance kick charged down which led to Visser's 11th try of the league campaign. Godman failed to convert.
O'Connor squeezed in another penalty before Edinburgh broke down the narrow side off a scrum and the excellent Jim Thompson passed for Paterson to dart away and over for an unconverted try.
Godman landed a penalty on the hour mark and Connacht had to defend manfully as Edinburgh continued to probe for tries.
But they were unable to do so. Indeed, Loughney was held up short as Connacht found a second wind.
O'Connor's replacement Jarvis gave the home side some breathing space with a 68th minute penalty and some great interplay between Muldoon and McCarthy produced a deserved seven-pointer for the latter.