The girl's brother told police the incident occurred when she had gone to get medicines from a store in Chiniot city, 200 km from the provincial capital of Lahore, on Wednesday.
The store's owner, Sarfraz Ahmed, forcibly took her to a deserted area and allegedly raped her with two other men. Later, they left the girl on a deserted road.
A passerby spotted her and took her to a nearby hospital.
As the police initially refused to register a complaint, the Lahore High Court took notice of the case and directed the Chiniot district and sessions judge to get a case registered against the accused and to submit a report within a week.
The gang-rape of a five-year-old girl in Lahore last month had triggered protests across Pakistan.