The girl lives with her elder sister and brother-in-law, and the accused are known to them.
A case under Section 376D of IPC has been registered and a police team is searching for the three who fled after the incident, said a police official.
In her complaint, the girl told the police that the incident took place yesterday when the accused came to her house, in the absence of her sister and brother-in-law, pretending to be searching for their pet dog and locked the door from inside.
The victim managed to scream, following which one of her cousins, who lives in the neighbouring house, came to her rescue but couldn't enter the victim's house as the door was locked.
The accused later assaulted the boy who tried to stop them while they were running away, police said.