Despite missing several international stars, the Irish side produced a resilient defensive display to edge out their hosts in challenging conditions.
The visitors struck first in the 19th minute when Henry McErlean crossed the try line after a sweeping wide attack. However, Ciarán Frawley was unable to add the conversion.
Leinster's second try came through Scott Penny, who powered over following sustained pressure, but another missed conversion - this time by Sam Prendergast - left the score at 10-0.
The Sharks, struggling with rhythm and cohesion, dominated possession at times but found it difficult to break through Leinster's well-organised defence.
A costly yellow card for Jaden Hendrikse, who kicked the ball out of an opponent's hands in a ruck, further hampered their momentum.
Their breakthrough finally arrived in the 52nd minute when Bongi Mbonambi crashed over from a driving maul, with Jordan Hendrikse converting to bring the hosts within three points.
They nearly levelled the match five minutes later when Ethan Hooker came close to scoring, only to be held up by Leinster's scrambling defence.
A crucial moment came late in the game when the Sharks were awarded a penalty in a kickable position.
However, captain Siya Kolisi opted for a line-out, seeking a match-winning maul. Leinster held firm, repelling the attack and securing a hard-earned victory.