James Smith found the crying youngster being comforted by her mother and dashed off in pursuit of the attacker.
Mr Smith was unable to find him in the network of paths and trees near the scene of the attack in South Queensferry.
The 54-year-old said the victim’s mum believed the stranger had just tried to abduct the girl on the secluded path.
The tattooed attacker – described as of “high school age” – had asked the girl if she wanted to see his dog before clutching his hand over her mouth.
The victim was targeted on a cycle path behind Queensferry Bowling Club between 1.30pm and 1.45pm on Friday.
Mr Smith had been walking with his nurse wife, Linda, 50, and their grandchildren.
The Edinburgh airport worker said: “We turned up and the mum and her lassie were there, both distraught. The attack had just happened.
“The mum approached us and said someone had tried to snatch her daughter. She gave me the description her daughter had just given her and I started looking for him. My wife got the mother to phone police.
“There’s loads of places to hide up there, with thick trees and bushes, and I couldn’t see anyone. I approached a couple with their wee girl, who were on the path, but they never saw him.
“I just wish I could’ve got my hands on him.”
The suspect is described as white with hazel brown-coloured hair that was swept forward.
He was wearing dark bottoms, a blue round neck T-shirt with white lettering and had a temporary tattoo on one of his hands. He also had a black and blue rucksack.
James added: “The girl had told her mum this guy approached her and asked did she want to see his dog. But he didn’t have a dog.
“Then he put his hand over her mouth. The mum was distraught and trying to call her man on her phone. The girl was trembling as she stood there. It was awful to see.”
Detective Inspector Julie Marshall, from Edinburgh’s Public Protection Unit, said of the tattoo and rucksack: “These are distinctive traits and I’m confident someone knows the individual responsible for this attack.”