The Scottish SPCA were called by Mr McLachlan, who then alerted Moffat Mountain Rescue team.
SSPCA Inspector Janet Proudlocked watched as Sparky was brought to safety by the abseiling team.
When Sparky was found he had already lost a third of his body weight so he wouldn't have survived for much longer.
"His owners were very sensible to distribute posters in the area with their contact details as this is ultimately how they were able to find him.
"There is no doubt that he is an incredibly lucky dog and I was delighted to be present at the happy reunion between Sparky and his owner.
More top news
An investigation by ITV News has found the breast screening unit at Morecambe Bay Hospitals Trust missed 14 cancers between 2005-2011.
A man who stole around £200,000 worth of clothing from his employer has been jailed for almost two years.
The Jim Clark Rally, which is being held away from public roads for the first time in nearly 20 years, is set to get underway this weekend.