Connacht left themselves wide open to a late sucker-punch from Edinburgh, so coach Pat Lam did not hide his relief when they secured only their second win in 13 Pro12 games.
The Westerners should have been chasing a bonus point, such was their dominance over an Edinburgh side who never built on an early breakaway try, but the home side failed to make the most of their pressure.
A superb performance from the Connacht pack laid the foundation for the win, but it was not followed through behind the scrum.
Craig Ronaldson had a nightmare off the tee, landing just one from five, to continue a dreadful kicking record for Connacht this season, with Dan Parks, the league's all-time top scorer, also out of sorts in this campaign.
A decent return from the boot would have seen Connacht pull away and, with daylight between the sides, the tries might have flowed. Instead, it led to a nervy finish and the home crowd feared the worst as the clock ticked down with just four points between them and the wind behind Edinburgh.
"We've had some close defeats and we just did not want to put another on there. It took a lot of guts, 7-0 down and we worked our way back into the game. But we missed quite a few opportunities. We could easily have been 19-7 up, but we made it real tough," said Lam.
"In the second-half, we played a lot better rugby, controlled it a bit better and we've come away with a win, so we're relieved, we're happy, but we know there are things to work on."
Lam admitted that wayward goalkicking has made a difficult campaign more arduous, with Ronaldson landing 10 from 23 (57pc) and Parks managing just 23 from 39 (59pc).
"We are at the bottom of the goal-kicking percentages. When you look at some of the teams that are four or five places above us, the only difference between us and fifth, sixth or seventh place is goal-kicking.
"Their (the top teams) kickers are 80pc and we're not, but that's just a skill that we've got to work on. I know that they are trying hard, but it would be good to get a return," added Lam.
The dominance enjoyed by Connacht led to a 12-2 penalty count in their favour, but Edinburgh coach Alan Solomons was fuming with Italian referee Claudio Blessano.
"I think we got blown off the field in the second half to be perfectly honest. I want to go and have a closer look at the film before making a comment, but certainly we were blown out of that game. He (the referee) had a major influence, you look at the penalty count," said the former Ulster boss.
Ronaldson converted his first penalty in front of the posts after 21 minutes to reduce Edinburgh's 11th-minute lead from Roddy Grant's try.
The Connacht out-half missed three more penalties with the wind behind him and, as a result, his team trailed 7-3 at the break.
The home pack continued to dominate after the restart and when Cornell du Preez was binned, 36-year -old lock Michael Swift led the onslaught to score only his fifth try in 175 league appearances.
Ronaldson hit an upright with the conversion, but Parks extended the lead when he came on with a penalty in front of the posts to seal a priceless win.
With a trip to play Zebre next weekend, followed by a home game against Treviso a week later, Lam believes "we can start moving up the table."
Connacht - R Henshaw (D Leader 67), F Carr, E Griffin, D McSharry (D Parks 52), T O'Halloran; C Ronaldson, K Marmion; D Buckley, J Harris-Wright (D Heffernan 51), R Ah You (R Loughney 65, Ah You 73); M Kearney, M Swift (A Muldowney 64); A Browne (G Nauoupu 72), J Heenan, J Muldoon.
Edinburgh - J Cuthbert; D Fife, N De Luca, A Strauss, T Brown; C Bezuidenhout (H Leonard 71), G Hart; W Blaauw, J Hilterbrand (R Ford 36), W Nel; G Gilchrist, I van der Westhuizen (O Atkins 64); M Coman (T Leonardi 72), R Grant, C Du Preez.
Ref – C Blessano (Italy).