Julio Ayala 18, was arrested and charged with rape, burglary and sexual abuse late Saturday night.
Police say on Wednesday night, Ayala managed to gain access through a window to the victim's second-floor bedroom in Prospect Lefferts Gardens. Once inside, officials say Ayala approached the victim while she was sleeping, and raped her.
Sources say police followed Ayala using video footage and traced him back to his home - from there, he fled to a construction site.
An angry mob that surrounded the location Ayala was cornered in erupted when he was captured.
"Everybody was happy, giving high fives to cops. They were happy that they got him," said one area resident.
The victim was taken to an area hospital in stable condition.
It does not appear the suspect and the victim knew each other.