NYPD detectives zeroed in on the Upper East Side apartment of Al Sharpton confidant Sanford Rubenstein on Sunday in their hunt for “rape” evidence, after an attempt to nail the high-powered attorney in a setup meeting with his accuser disintegrated.

Investigators spent about an hour-and-a-half in the palatial penthouse on East 64th Street, where Rubenstein was holed up with his top-notch lawyers, Michael Ross and Benjamin Brafman. A team of NYPD crime scene specialists then moved in and began scouring for evidence.

Detectives had Rubenstein’s accuser call him Friday and secretly record the chat to see whether he would incriminate himself, sources said.

The two discussed having sex but nothing incriminating was said. A second face-to-face meeting planned for Sunday was canceled after an online report late Saturday revealed the woman’s claims, alerting Rubenstein to the probe, the sources said.

The meeting was deemed crucial to a case stymied by a lack of evidence, the sources said.

The same tactic was used in the infamous NYPD “rape cops” case, in which a woman secretly recorded Police Officer Kenneth Moreno after he allegedly assaulted her. Moreno was acquitted of rape but convicted of official misconduct.

Sharpton sought to distance himself from Rubenstein on Sunday, saying, “I don’t care how close we are. If he’s wrong, he’s wrong. If he’s right, we’ll see.”

The woman posted a quote from Eleanor Roosevelt on her Facebook page Sunday:

“We gain strength, and courage and confidence by each experience in which we really stop to look fear in the face. We must do that which we think we cannot.”

“She is scared and embarrassed,” a police source said, referring to the woman, a 42-year-old retail company executive and longtime top aide to Sharpton at the National Action Network.

Rubenstein, who has served as Sharpton’s personal lawyer and as an ally in several high-profile civil rights lawsuits, had not been charged as of Sunday night.

“We’re doing more follow-up investigation,” a law enforcement source said. “It’s a classic ‘he said, she said’ right now.”

Authorities are weighing a potential third-degree rape charge, a felony that involves sexual intercourse with a person who is unable to give consent.

Rubenstein said through his lawyer that he “denies any criminal conduct whatsoever.”

The woman told police that she passed out at Rubenstein’s place after both attended Sharpton’s 60th birthday bash at the Four Seasons restaurant Wednesday night and that she groggily awoke several times to find him “violating her” but was helpless to do anything, sources said.

She had been drunk before heading back to Rubenstein’s pad with a female pal, sources said.

“She drank more than she should have while she was there, and it was noticeable,” said a NAN source who talked to a partygoer.

Rubenstein — who handles big-money lawsuits against the city, particularly those targeting the NYPD — routinely brings a rotating cast of African-American women in their 20s and early 30s to functions, and had arrived at the party with another woman, sources said. Before heading home, he allegedly latched onto the alleged victim, whom he knew.

Instead of driving the mother of two to her Brooklyn home, Rubenstein allegedly stumbled into his luxury building with the woman clinging to one arm and her pal on the other, said a source in the building.

One of the women was overheard telling Rubenstein, “You’re kind of famous, aren’t you?”

“You could say that,” he replied, according to the source.

Law enforcement sources said that once upstairs, the trio shared a drink on the penthouse terrace before the alleged victim’s pal left at around 3 a.m.

When the woman regained full consciousness the next morning, she allegedly discovered bloody condoms on the floor and rushed out of the apartment, still bleeding from the sexual contact, sources said. Rubenstein hurriedly trailed her, a source said.

“She did not look happy,’’ the building source said.

The Post is withholding the name of the victim, who declined to comment Sunday. A source close to Rubenstein said the lawyer had consensual sex twice with the woman, at night and then when she awoke.

“There’s evidence to the effect that it was the complainant who asked her friend to leave so she could be alone with Rubenstein,” the source said. “And there is additional evidence that there was consensual sex between her and Rubenstein in the evening and again in the morning.”

Additional reporting by Shawn Cohen, Reuven Fenton, Priscilla DeGregory, Julia Marsh, Philip Messing and Carl Campanile