Lothian and Borders Police are now trying to trace the animal, which is described as being brown with black spots. No owner was immediately present when the incident happened.
Officers also want to speak to the man who came forward to help the family.
Inspector Roddy Hardy said: "This was a traumatic incident for the child and we are grateful that there was a member of the public available to help them. The dog responsible had no owner that the mother could see, and ran off in an unknown direction.
"As such, we are keen to trace the animal as a matter of urgency to ensure no further incidents occur.
"Similarly, we are keen to trace the good Samaritan who came to the aid of the little girl to see if they have any further information to help with our enquiries."