The 19-year-old accused, identified as Vedprakash has been arrested.
The girl lived in Aaya Nagar area of Fatehpur Beri. The accused, who was identified as Vedprakash, lived in a rented accommodation in the same building where the victim lives with her family, said a police official.
The incident took place when the parents of the victim, after putting their daughter to sleep, had gone down for some work.
Taking advantage of the situation, the accused reached the terrace and sexually assaulted the victim. He then threatened her of dire consequences and fled the place.
The medical examination of the girl confirmed that she was raped following which a case under Sections 376 (rape) and 506 (criminal intimidation) of IPC and relevant sections of the Protection of Children from Sexual Offences (POCSO) Act, 2012, was registered and the accused arrested, police said.
Vedprakash is unemployed and was living in the rented accommodation for the past six months.