A drop goal from Ben Healy with the clock in the red has handed Connacht their first loss of the URC season.
Cian Prendergast thought he had rescued a draw with a last gasp try to make it Edinburgh 22 Connacht 22 with 2 minutes remaining.
However, the former Munster man slotted over in front of the posts to give the Scottish side their third win of the campaign.
The Lions struck late to get a 24-23 win over the Scarlets while the Glasgow Warriors came away from the Ospreys with a 31-23 victory.
Benetton got the better of the Stormers by 20 points to 17.
Leinster are looking to keep up their winning run in the United Rugby Championship this afternoon.
They're in Wales to face the Dragons with kick off at Rodney Parade at 1:15pm.
Scrum half Ben Murphy makes his first start for the province and is joined in the half backs by Ross Byrne.