Sharratt saw off Hosny, winner of the shield in 2017, after a match lasting the best part of an hour, the scores being 16-14, 15-13, 12-15, 11-15, 17-15.
The veteran surprised both himself and his younger opponent by going 2-0 up, albeit by the narrowest of margins.
The student got into his stride in the third game, though, winning that one and the next one by margins of three points and four to tie the score at 2-2.
Come the decider, Sharratt was under the cosh, but although he was tiring quicker than the younger and fitter Hosny, he was determined to win.
At 13-13, he served out and thought he had blown any chance of victory, but, mustering one last effort, he saved three match points and a deft forehand drop sent Hosny the wrong way to take the match and title.
Sharratt said afterwards: “The Alex Doherty memorial shield is a prestigious trophy to win.
“The late Alex Doherty single-handedly kept the squash club going during its barren years and it wouldn’t exist today if it wasn’t for him.
“This trophy holds great standing in the club and I just wanted it more.
“Amir has played at top seed in the Border Reivers team and is regarded as one of the top players at the club, so I am thrilled with the victory. It’s probably the hardest I’ve had to work for a victory but I was determined and just wasn’t going to stop running.”