A lawyer for New York City faced skeptical questioning from some federal appeals judges on Tuesday as she tried to defend the 2013 arrest of a 73-year-old Wall Street lawyer who stopped on the sidewalk to talk with Occupy Wall Street protesters held behind a barricade.

In a case that raises questions about the extent of police power to control protests, lawyer Stephen Kass sued the city and the police for false arrest, arguing a citizen has a right to talk to protesters. The city appealed a ruling by a lower court judge that the officers had no immunity.

“He was listening to what the protesters had to say,” said 2nd U.S. Circuit Court of Appeals Judge John Walker, who peppered city lawyer Melanie West with questions. “You’d agree that he has a First Amendment right to listen to the protest?”

“This is troubling to me,” said another member of the appeals panel, Judge Raymond Lohier. “I can see anyone showing up at a barricade and all of a sudden being arrested.”

Kass, an environmental lawyer with the firm Carter Ledyard & Milburn LLP, was on his way to a music lesson when he stopped to speak with a protester in lower Manhattan’s Zuccotti Park about a “Tax the Rich” sign, according to his complaint.

He was told to leave or move inside the barricades by police, who said they were concerned about obstruction of the sidewalk, and he refused, telling them he had a right to use the sidewalk. A video made part of the suit showed the sidewalk wasn’t blocked.

West said Kass was given every chance to avoid arrest — refusing seven orders to move along — and left officers no choice. She said they were entitled to immunity unless it was “clearly established” for any reasonable officer that an arrest would be unlawful.

“These officers should have some discretion to anticipate problems and head them off,” she said. “If you allow one person to engage, then it is difficult to understand how you could direct a second person to move along.”

But Walker said forcing Kass inside the barricade would have made him part of a protest he didn’t want to join, violating his “freedom to not associate” and potentially embarrassing him if any of his law partners walked past and saw him.

“I don’t think the NYPD has a duty to ensure that Mr. Kass keeps his job,” she responded.

And Lohier wondered if police would be able to interfere if a member of the press like Barbara Walters stopped to talk to protesters. West answered: “If the police approached Barbara Walters and asked her to move 10 feet seven times, yes, I think they could.”

Andrew Celli, a lawyer for Kass, said the case was about “the right to listen.”

“He stopped to ask a question,” Celli said. “The police have to have a basis for asking someone to move along.”

But the third member of the appeals panel, Judge Denny Chin, expressed some sympathy for the city’s position, questioning whether it was clear to officers that an arrest was illegal if they were under orders to keep the sidewalk open.

“Do you really expect police officers to say, ‘Oh, I’m going to make an exception because this man is a 73-year-old lawyer?’ ” he asked Celli.

The judges gave no indication of when they will rule.