It is understood that the youngster was with a group of friends when her skin was pierced by the hypodermic.
The needle had been left in the grass at the play area off Corserine Terrace in Bellsbank, half a mile from the market town of Dalmellington.
The child came into contact with it while playing there at around 7pm on Tuesday evening
She was taken to University Hospital Ayr 25 miles away for treatment and was then later discharged.
A specialist team from East Ayrshire Council later arrived at the park, which is situated among houses, and conducted a clean-up, sweeping it for further discarded needles.
Chief Inspector Nathan Calderwood, the local area commander in charge of the response officers, community officers, and the criminal investigation department,appealed for information about who may have left the needle and urged them to contact Police Scotland.
He said: "Leaving a used needle in a playpark like this is an incredibly reckless and irresponsible act and inquiries into the incident are now ongoing.
"My officers will be present within the community to provide reassurance and I would ask that you speak with them regarding any concerns you have.
"East Ayrshire Council has been contacted and the playpark has been thoroughly checked and cleaned.
"I would urge anyone with information to come forward and speak to police by calling 101, quoting incident 2998 of 14 June or call Crimestoppers anonymously on 0800 555 111."