Toulouse impressed throughout at Stade Ernest-Wilson and led 21-13 at half time thanks to the boot of Thomas Ramos and tries from Maxime Medard and Sofiane Guitoune.
Leinster emerged from the break with renewed energy and racked up 14 unanswered points to lead 27-21 before the hour, Jonny Sexton converting scores from James Ryan and Sean Cronin.
It was not enough for the defending champion, as Medard crossed with 12 minutes remaining, enabling Ramos to kick the match-winning points.
Victory ensured Toulouse maintained its 100 per cent record after two matches, a feat shared by Newcastle Falcons in Pool 5.
The Falcons left it extremely late to seal a 23-20 success over Montpellier, Callum Chick crossing nearly nine minutes after the clock went into the red.
Ruan Pienaar had kicked Montpellier into the lead after trailing at half-time, but a 39-phase move opened the door for Chick and he duly accepted to move Newcastle to the top of the table.
Glasgow Warriors' win over Cardiff Blues was much more straightforward, Adam Hastings top scoring as the Scottish side eased to a 29-12 victory in the Welsh capital.
Hastings, DTH van der Merwe and Ali Price all crossed in the opening 40 minutes and, although Cardiff tried to fight its way back, Glasgow proved too strong.