Police on the Upper West Side have opened an investigation into reports that individuals posing as city police officers fraudulently gained access to a building on West 93rd Street and questioned two of the tenants there about their residency status.

The incident occurred on Aug. 20. According to the building manager, Porfirio Gonzalez, three men entered 50 West 93rd St. and bypassed the front desk by flashing badges and telling the doorman they were from the NYPD.

“I don’t know what they came to us for,” Gonzalez said.

He said two detectives from the 24th Precinct came to look at surveillance footage.

“[The detectives] took some pictures of the three guys that were here, but they didn’t recognize them,” said Gonzalez, who noted the unknown men were in the building for less than 20 minutes. “They’re not from the precinct.”

“They were asking the tenants how long they lived there and who lived with them,” he added.

Both tenants are rent stabilized, Gonzalez said. The entire building, according to staff, is also rent stabilized. Gonzalez said the police took possession of the surveillance tapes for their investigation.

A police source familiar with the incident said officials from the 24th Precinct met with building residents and staff on Aug. 25 and that an investigation was opened the next day.

“It is still a possibility that they belong to another city agency but the investigation would prove [or] disprove that theory,” the police source said.

According to a press release issued by Councilmember Helen Rosenthal after the incident, however, police will only knock on a resident’s door if they are investigating a crime and always wear a suit. None of the men pictured in the surveillance images seen by the Spirit are wearing suits, and their badges appeared to be hanging on chains around their neck.

“Sheriff’s marshals wear their shields on a chain, but they will only come if you have already been notified that you are being evicted and have been to housing court,” according to communication from Rosenthal’s office. “They will also have paperwork with them.”

Rosenthal’s announcement also directed tenants to not open their doors if a person is vague about their intent, “For example,” the announcement reads, “they may ask: ‘Who lives here?’ or “Who else is at home now? or ‘Who are you?’ or ‘Do you sublet?’ These are open-ended questions and would not be asked by a police officer.”

A spokesperson for Rosenthal said her office is unable to comment on the ongoing police investigation.