Mr. Heller said the leaks were unusual and damaging disclosures that served only to harm Mr. Gooding’s reputation. “From my perspective, the damage has already been done,” he said.

One of the law enforcement officials, who was briefed on the leak case by several people, said the Internal Affairs Bureau had interviewed four people, including the case detective, before settling on Detective Ulan as the likely culprit. Although it was not his case, Detective Ulan had looked up Mr. Gooding’s mug shot in the police photo-management system, the official said.

Detective Ulan is the second Special Victims detective to face discipline over the past month in connection to a high-profile sexual assault case involving a celebrity. Sergeant Keri Thompson, the commander of the division’s DNA cold-case squad, is also under investigation over her relationship with a model who accused Mr. Weinstein of groping her in 2015.

The movie producer is scheduled to go to trial in January on charges that he sexually assaulted two women. Prosecutors say Mr. Weinstein raped one woman in a hotel room in Midtown Manhattan in March 2013, and forcibly held down another and performed oral sex on her at his New York apartment in 2006.

More than a dozen women have accused Mr. Gooding, 51, of making unwanted sexual advances on them, including pinching their buttocks or kissing them, prosecutors have said. The actor, who won an Oscar in 1997 for his role in the movie “Jerry Maguire,” has denied wrongdoing.

Prosecutors have charged him with groping two of the women at nightclubs in Manhattan, and he is due in criminal court on Thursday to answer to similar charges related to a third accuser.

Detective Ulan received the department’s third-highest honor in 2017, when he was awarded the medal of valor. The police said that in 2015 he shot and wounded a gunman who fired at someone else and then turned the gun on the detective.