The Irish province looked in serious danger of losing its opening match as Cardiff surged into a 29-14 lead 10 minutes into the second half.
But Leinster showed exactly why it is champion with a stirring fightback led by replacement forward Bryan Byrne.
The hooker crossed twice, either side of Jamison Gibson-Park's score, as Leinster put itself within touching distance of victory, and Ross Byrne completed a barn-storming finish with a 78th-minute conversion.
Leinster's fellow Group B sides did not fare as well, though, as Edinburgh and Southern Kings both fell to defeats.
Edinburgh earned a losing bonus point in a 17-13 reverse against a George North-inspired Ospreys, while the Kings were well beaten by Zebre in Parma.
Zebre dominated from the start and ran in four tries on its way to a 32-16 triumph, Carlo Canna slotting 12 points amid scores from Oliviero Fabiani, Mattia Bellini, Jimmy Tuivaiti and Apisai Tauyavuca.