The girl, a Grade VIII student, told police that she was assaulted when she visited the home of her friend in Kahna area of Lahore.
"My friend's brother, who was alone in the house, locked me in a room. He then called his two friends and they raped me," she said.
The alleged rapists told the girl that they had made a video of the incident and would upload it on the Internet if she did not give them money.
"The girl initially did not tell her family about the incident. When she was caught red-handed stealing money by her mother, she told the family about it," Superintendent of Police Tariq Aziz said.
The girl paid money to the accused on three occasions, Aziz said.
Police have arrested the accused and registered a case against them.