The lawyer for a white NYPD sergeant sued by a Black detective for creating a hostile work environment told an appeals court panel the accused has a “constitutional right not to like different people of different races.”

The argument, by lawyer Lalit Loomba, who represents now-retired Sgt. Martin Toczek, was made April 23 before the state’s Appellate Division, First Department, which on Tuesday reinstated an earlier decision dismissing a lawsuit by Det. Otis Taylor that accuses Toczek of openly sharing his dislike of Black people and saying he had a First Amendment right to do so.

Taylor’s lawyer, Fred Lichtmacher, said it’s not yet clear if New York City will settle the suit or take it to trial — or why Toczek wasn’t booted from the force.

“It doesn’t speak well about the NYPD taking racism seriously,” Lichtmacher said, adding, “What’s next? What kind of slippery slope are we on?”

Toczek could not be reached for comment. He retired in 2025, the NYPD said, but it wasn’t clear if he was disciplined after Taylor made his allegations.

In the suit, filed in Bronx Supreme Court in 2021, Taylor, who by then had retired, said that while assigned to the department’s Auto Crime Unit, Toczek, his direct supervisor, shared his dislike of Black people and plastered offensive memes on the office walls, including one mocking former NFL quarterback Colin Kaepernick for kneeling during the national anthem.

Taylor said that when he explained Kaepernick was exercising his constitutional right to protest, Toczek responded by saying he had the right, under the First Amendment, whether or not to like Black people, according to the suit. Toczek also allegedly shared articles about Black players committing crimes.

“Day in and day out he’d say these inappropriate things and you pretty much have to live with it because you don’t want to get reassigned,” Taylor told The News at the time. “He’s a f—–g bigot.”

The lawsuit was dismissed in October 2024 but Lichtmacher appealed.

At the appeal hearing on April 23, Loomba noted that Taylor had previously testified he was never subjected to a racial slur or “treated any worse” than others in the unit.

But Marsha Michael, one of the five judges on the appellate panel, said there was “racial animus” inherent in Toczek’s assertion he had the constitutional right to like or not like Black people, Loomba, while not condoning racially charged statements, echoed the sergeant’s constitutional contention.

“I respect the question,” he told the panel, “and, you know, I think that there is a constitutional right not to like different people of different races.”

Michael noted that “making that pronouncement at your place of employment, where you’re working with all types of different people, a jury could find that that creates a hostile environment.”

Loomba did not try to refute the judge, but noted Taylor never said Toczek uttered a racial slur. In response, Martin Shulman, another judge on the panel, said, “A person could talk to the wall, knowing that the plaintiff is there.”

Taylor also alleged in his suit that Toczek displayed his dislike of Black people by ordering him to arrest a Black man who had assaulted a white detective — even though Taylor was on restricted duty because of a shoulder injury and was working without his gun.

Taylor wound up making the arrest but re-injured his shoulder and was forced to retire in 2020 after 14 years on the job.

The appeals panel, in its decision, found that the sergeant’s comments about having the right to say if he likes Black people was “facially discriminatory and is alone sufficient to defeat summary judgement.”

“Further, it is a jury issue as to whether Toczek’s other comments about the NFL reflect racial animus,” the panel added. “A reasonable juror could conclude that, once Toczek signaled that his objection to the protests were at least in part about race, every other reference to the protests and the NFL became infused with racial animus.”

In addition to Toczek, the suit is also directed at New York City.

In a statement to the Daily News, a city Law Department spokesperson said: “The City has zero tolerance for discrimination of any kind. While we believe the lower court ruling was legally correct in dismissing the case against the NYPD, we made it clear in our papers that the comments made by Sgt. Toczek were ‘rude and unprofessional,’ as well as ‘overbearing and obnoxious.’”