The city’s top cop said Tuesday that the two detectives accused of raping an 18-year-old woman in Coney Island last month would “pay the price” if the allegations are true.

“If these two detectives did something wrong, then they’ll pay the price,” NYPD Commissioner James O’Neill said.

The detectives are accused of forcing the Brooklyn teen to perform sex acts on them in a police van. They have been placed on modified duty, as has their NYPD supervisor.

The detectives have been identified by sources as Richard Hall and Eddie Martins. The supervisor was identified as Sgt. John Espey.

The teen told cops that one of the officers raped her, and both detectives forced her to give them oral sex in a Chipotle parking lot on Sept. 15, after threatening to take her to the police station.

Sources said the cops claim the acts were consensual.

“If this is true…I’d be extremely disappointment,” O’Neill said.

O’Neill said the NYPD’s Internal Affairs Bureau and Kings County

District Attorney’s Office were working together on the case.

The officers could be charged with anything from official misconduct to rape, depending on what investigators find, a police source said.