A Manhattan man was charged Monday with allegedly trying to rape a 20-year-old woman inside a Stuyvesant Town building last week, police said.

Juan Scott, 26, was charged with first-degree attempted rape for allegedly following the woman into the elevator of the building at about 4 a.m. on Friday, police said.

The woman put up a fight when Scott, who lived around the corner, allegedly attacked and he fled, police said.

Scott was awaiting arraignment Monday and could not be reached for comment.