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 champions, though, as Medard crossed with 12 minutes remaining, enabling Ramos to kick the match-winning points.
Victory ensured Toulouse maintained their 100 per cent record after two matches, a feat shared by Newcastle Falcons in Pool 5.
— Newcastle Falcons (@FalconsRugby) October 21, 2018
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 their way back, Glasgow proved too strong.
RugbyPass has created a next generation rugby rating system, based on machine learning and shaped by game winning moments. The system (RPI) is a world first for its complexity and comprehensive embrace of northern and southern hemisphere players and teams. By using in-depth data analysis, RPI determines exactly what it takes to win, in real time. Explore the RPI now!