The Brooklyn DA’s office is investigating allegations that the two teens beaten to a pulp by an enraged boyfriend outside a Brooklyn Mosque were​ ​sexually assaulting his girlfriend, The Post has learned.

The probe was launched after the unnamed woman claimed that the teens were taunting and molesting her when her boyfriend, Christopher Vallaro, ran to her rescue.

Vallaro first made headlines after photos of the 16 and 17-year-old’s battered faces surfaced, along with allegations that the 31-year old had called the boys “f—king terrorists.”

But investigators with the DA’s office have scheduled a meeting with Vallaro and his girlfriend to look into the accusations that the teens reached through the car window and groped her breasts and body, sources said​. Vallaro ​came to her rescue when he heard her screaming for help from floors above in his apartment, which is located adjacent to the Sunset Park mosque.

The July 2 beating was originally investigated as a hate-crime, but police later concluded the teens’ Muslim faith was not a motivating factor.

During a brief Wednesday appearance, defense attorney Sal Strazzullo submitted 20 letters from his client’s neighbors, mostly Muslim-Americans, in Vallaro’s defense.

“I’m glad that the District Attorney’s office is taking a look at the entirely of the situation, and not just what the alleged victims said happened,” Strazzullo said.

Vallaro declined comment as he left court.