Contepomi claimed the man-of-the-match award, scoring a try and kicking two conversions and three penalties as Leinster won the battle of the Magners League sides.
The Argentinian scored the clinching try in the 72nd minute after Edinburgh had played themselves back into contention at 21-14 down.
Winger John Houston dashed over for a try, six minutes into the second half, and penalties from Phil Godman and David Blair followed as Andy Robinson's threatened to turn the game on its head.
A relieved Contepomi said afterwards: "We are in a very tough pool and all the teams we play are difficult to beat, so while we would have liked five points, we first and foremost wanted the win.
"Edinburgh have some very good individual players. We knew that it was going to be difficult and we're not focused on (the) maths part of the group after round three of the competition."
Keen to pay tribute to a Leinster pack that has been firing on all cylinders in recent weeks, he added: "The pack are playing really brilliantly and when they are going forward it makes my job as a fly-half that much easier.
"We need to win our three remaining games, and to focus on winning, full stop."
Leinster coach Michael Cheika was left cursing his side's second-half performance after they let their intensity drop, allowed Edinburgh get back into game and ultimately missed out on what seemed a very achievable bonus point.
"I'm happy with the win. I'm never keen on losing but I would have liked to have got the bonus point," Cheika admitted.
"We didn't perform well enough in the second half, we took our foot off the pedal in the second half, especially in the ruck area. We've a good bit to work on ahead of the return match at Murrayfield next weekend."
Next Saturday's meeting between the sides will count for little for Edinburgh as they remain winless and rooted to the bottom of the pool table, although coach Andy Robinson took some positives from his side's display in Dublin.
Robinson said: "Some of the rugby we played, the work between the phases, the interplay between forwards and backs, was very good. We gelled well and put it up to a very good Leinster team.
"I thought the Leinster pack played well, they dominated the game there. We'll regroup and take what we can from the game. We need to look at ourselves in terms of the set piece and see how we can get more of a platform there."