The Irish side came into the game on the back of two successive RaboDirect PRO12 victories over the Dragons and Treviso.
In Italy a week ago it was Jonny Sexton who needed a late drop goal to hand the European champions the win and the Ireland fly-half took that form into this clash at the RDS with an early try.
Greig Laidlaw kept the visitors in touch but despite a late try from WP Nel, Michael Bradley's team were forced to settle for a losing bonus point.
The game was preceded by a minute's silence for Nevin Spence and his brother Graham and father Noel who passed away in a tragic farming accident last Saturday.
When the game got underway it was Joe Schmidt's team that made the faster start and they took the lead after just eight minutes through Sexton.
The try came after a bullocking run from Ireland prop Cian Healy who caused havoc in the Edinburgh defence.
With the visitors stretched Leinster mounted attack after attack, and eventually the ball was sent wide to Sexton who brushed through a couple of tackles to dive over.
Sexton added the conversion and a penalty five minutes later to send Leinster into a 10-0 lead after 15 minutes.
Laidlaw responded with his first penalty of the day before D'Arcy was forced off, with Macken coming on in his place.
Laidlaw added a second penalty just after the half-hour but Leinster led 10-6 at the break.
The match was evenly poised but two yellow cards in as many minutes, to John Yapp and Sean Cox, gave the home side the initiative.
They took full advantage of their extra men and it was Macken who crossed for their second just before the hour mark.
Sexton missed the conversion, and five minutes later Laidlaw knocked over his third penalty of the day to reduce the deficit to six.
A second try from Macken with quarter of an hour remaining proved decisive, Sexton's conversion stretching the home side's lead to 22-9.
Nel's effort ten minutes from time set up a grandstand finish, with Laidlaw's conversion bringing his side back to within a score but the Irishmen held out for a third win of the campaign.
|Leinster Rugby Score Card|
|Edinburgh Rugby Score Card|