In the end they had to rely on the kicking prowess of stand-in skipper Felipe Contepomi who kicked four penalties and two conversions.
The vistors were in control in the opening period and had built a 13-9 lead by the break thanks to a try from lock Craig Hamilton, converted by Dan Parks, who also added a further penalty and a neatly taken drop goal before the interval.
Leinster had to rely on three penalties from their Argentinian star to keep them in touch.
The Irish province found their stride in the second period and their reward was two tries in the first quarter hour.
Contepomi and Lewis worked well to put Rob Kearney into space. He then kicked ahead before racing onto to the ball to take advantage of some lacklustre defending and grab a try.
Their second try came courtesy of Kieran Lewis who benefitted after Guy Easterby had stolen possession for the hosts.
Contepomi converted on both occasions but Glasgow refused to give the game up.
Glasgow replacement scrum-half Graeme Beveridge spun a long cut-out pass to put hooker Scott Lawson into the Leinster 22 and Sean Lamont galloped up on his shoulder to score.
Parks converted and swapped a further penalty with Contepomi but in the end Leinster did just enough to hold on for the win.