The Irish province, who lead the Championship table, pounced after just five minutes thanks to Dan Leavy.
Tomos Williams struck with a stunning team effort soon after but Leinster led 14-7 at half-time after Luke McGrath sniped over.
Leinster controlled much of the second-half but Wales’ Capital Region were electric on the counter.
Williams completed his brace just six minutes into the second-half and Sion Bennett finished another strike from distance, following a Leinster penalty.
But the hosts edged back in front following a Ross Molony try and held out for the win, despite some big pressure on their defence in the final stages of the game.
Despite the agonising defeat, Danny Wilson’s side will take a huge amount of confidence from their performance just a week ahead of a huge European Challenge Cup quarter-final against Gloucester.
Leinster dominated the opening minutes at the RDS with sustained periods of pressure and the territorial advantage however they did little to threaten the Blues.
That was until Noel Reid broke through midfield but Anscombe chopped him down and Josh Navidi forced a turnover.
The Blues were able to exit but another wave of Leinster attack was soon forthcoming and this time it led to a try.
A beautiful delay and dummy from Noel Reid, which fixed the defence before he grubbered to the corner unlocked Cardiff Blues’ defence.
Leavy collected in the corner, with the try-line at his mercy, and despite the best efforts of Matthew Morgan, the big blindside crashed over.
Ross Byrne slotted the conversion from the touchline to give the hosts a 7-0 lead after five minutes.
Despite the set-back Wilson’s side were undeterred. They left empty handed from their first period of territory but soon struck with a sensational counter-attacking try.
It all began with a huge Corey Domachowski hit in midfield, which allowed his side to force a turnover and from there Leinster were on the back foot.
Quick hands from Jarrad Hoeata and Rey Lee-Lo released captain Blaine Scully down the left wing.
He skipped out of Adam Byrne’s tackle before returning the ball to Lee-Lo and the Samoan international drew Joey Carberry before offloading to the on rushing Williams.
The scrum-half dotted down under the sticks, allowing Shingler a simple conversion to which he made no mistake.
Wales’ Capital Region continued to threaten on the counter-attack, with the back-line looking particularly sharp.
Another combination between Scully and Lee-Lo almost paid dividends before Navidi and Alex Cuthbert maintained the momentum with strong carries.
The ball was maintained and moved back to the left wing but Shingler’s miss-pass was slightly off que, forcing Scully to delay and he was tackled comfortably before the ball was turned over.
Leinster soon rallied and forced a penalty after powering through the Cardiff Blues scrum, with Anton Peikrishvili struggling with an injury and losing a boot.
They kicked to the corner but Cardiff Blues defended the driving lineout with aplomb, forcing the hosts to move the ball wide, where they eventually coughed up possession.
The visitors worked their way out of the red zone but moments later Leinster were back and Luke McGrath sniped over from close-range. Byrne converted to give the home side a 14-7 lead after 32 minutes.
Cardiff Blues rallied in the closing stages of the half, with Lee-Lo, Anscombe and Cuthbert looking dangerous every time they had the ball but they were unable to breakthrough as the score remained 14-7 at the break.
Wales’ Capital Region weathered a storm in the opening stages of the half, with Adam Byrne displaying a fine array of kicks to pin the Blues into their own half.
Leinster then went through phase after phase but they were met on almost every occasion by a thunderous hit.
And on 46 minutes the Blues broke out to claim a second scintillating try on the counter attack.
Anscombe fielded another tricky Byrne kick but displayed some dazzling foot-work to beat two defenders before popping a basketball style pass to Dacey.
The hooker showed pace more akin to a back as he eased around the defence, from just outside his own 22, and broke clear
He reached the Leinster 10-metre line before drawing Carberry and putting Williams away for his second.
Leinster hit-back with a penalty and were growing in prominence as they launched several sustained attacks.
However on each occasion the Blues held on and when the ball was lost they struck on the counter-attack once more.
The ball was rushed to the left and in the nick of time Shingler was able to release Lee-Lo. He went on the outside before feeding Scully and the USA international drew the last man before finding Bennett in support.
The back-row forward still had plenty to do but he galloped 50-metres for a fine score, which Shingler converted.
Despite the score Leinster continued to control territory and possession and a score felt ominous.
It eventually came after a series of penalties, which Leinster dinked to the corner and Ross Molony burrowed over.
Byrne skewed the conversion but the try had given the Dubliners a slender one-point lead in the final quarter.
Some superb play from Cuthbert put the Blues back in the ascent after he collected a kick close to his own try-line, bounced a defender and then pummelled the ball into touch on the Leinster five-metre line.
The Blues threw everything at an equally determined Irish outfit in the closing stages but they were unable to manufacture a match-winning breakthrough as the hosts clung on.