Almost as soon as the video of one subway rider choking another to death began to ricochet across the internet, the killing came to signify more than the tragic death of one man.

For many New Yorkers, the choking of the 30-year-old homeless man, Jordan Neely, was a heinous act of public violence to be swiftly prosecuted, and represented a failure by the city to care for people with serious mental illness. Many others who lamented the killing nonetheless saw it as a reaction to fears about public safety in New York and the subway system in particular.

And some New Yorkers wrestled with conflicting feelings: their own worries about crime and aggression in the city and their conviction that the rider had gone too far and should be charged with a crime.

Now, as prosecutors continue to investigate the circumstances of Mr. Neely’s death, the case has become a political Rorschach test, dividing the city along long-simmering fault lines.

Mayor Eric Adams and Representative Alexandria Ocasio-Cortez, two of the city’s most prominent Democrats, criticized each other’s response in an uncommonly tense exchange. The death of another Black man in a chokehold — this time at the hands of a civilian — prompted sharp comments from Adrienne Adams, the City Council speaker, over racism in the legal system.

And in a city where disturbing subway encounters are a fact of life, many wrestled with uncomfortable questions about how they might respond when faced with a person who is both frightening other riders and obviously in crisis.

The debate over how best to help people with mental illness is taking place in cities across the nation and has been particularly vexing in liberal cities like New York, San Francisco and Los Angeles, where homelessness and mental illness soared during the pandemic and people in dire need are often in plain sight on park benches and subway trains.

These cities have sought out innovative solutions to assist those with mental illness — pouring money into housing programs, street teams and community centers — and have also cleared subway homeless encampments, and weighed harsher tactics.

In the wake of Mr. Neely’s death, the debate has become especially heated. After Ms. Ocasio-Cortez wrote on Twitter that Mr. Neely had been “murdered” and another left-leaning official, Brad Lander, the city comptroller, called his attacker a “vigilante,” Mr. Adams called their comments irresponsible in an interview on CNN on Wednesday night.

Mr. Adams, a former transit police officer in his second year as mayor, said on Thursday that he would wait to weigh in until the police and the prosectors had investigated what happened.

“There are many layers to this,” he said at an unrelated news conference. “Let the process follow its course.”

On the F train in Manhattan on Monday, Mr. Neely, a subway performer and dancer who also had a history of mental illness and erratic behavior, had been yelling at passengers, saying he was hungry and thirsty, but also at one point that he was ready to die, according to one witness.

There is no indication that he was violent or that he made any direct threats.

But one of the train’s riders, a former marine who has not been identified by officials, approached Mr. Neely, put him in a chokehold, and held him until he became limp.

It does not appear that any riders intervened to help Mr. Neely; at least two other riders appeared to help pin him down. Mr. Neely was later pronounced dead at a hospital in Greenwich Village. Law enforcement officials are still investigating the incident and have not yet decided whether to charge the man.

Asked what New Yorkers should do in a similar situation, Mr. Adams focused on Mr. Neely’s presence on the train, and did not discourage people from seeking to restrain someone.

“We need to be extremely clear that from Day 1 of this administration, I focused on: We cannot have people with severe emotional illnesses on our subway system,” he said.

Every New Yorker has a story of witnessing an outburst or a violent episode on the subway and struggling over how to respond: To confront or flee; to intervene when two riders are at odds; to call for a police officer, or to look away.

Many have grown worried about safety on the subway after experiencing violence or reading about it in the news. Others are so accustomed to conflict that they ignore it.

On Thursday at the Broadway-Lafayette station in Manhattan, where Mr. Neely was removed from the train and taken to a hospital, David Alexander, 45, a superintendent who lives in Manhattan, said that he avoided volatile subway riders and would not risk intervening himself.

“If I see something happen, I get up and go to the next car,” he said, adding: “You don’t get involved — you could end up hurt, you could end up killed.”

Rahnuma Tarannum, 25, a data analyst who lives in Brooklyn, said that she felt so unsafe on the subway that she carried pepper spray. Though it is unclear if there were police officers nearby or on the train, Ms. Tarannum said that while she deeply regretted Mr. Neely’s death, the incident supported her belief that the police need to be doing more.

“Because police are not doing their job, that’s why the citizens of New York are taking the law into their hands,” she said. “Somebody has to do something.”

Mr. Adams and Gov. Kathy Hochul have vowed to make the subway safer after a series of violent episodes, including stabbings and fatal shoves, that have often involved homeless people attacking others. Homeless people are also frequently the victims of violent crimes.

Crime rose on the subway during the pandemic, but the subway is less dangerous now than in the 1980s and 1990s, when there were more than two dozen murders in a single year. There were 10 murders on the subway last year, compared with about two murders per year, on average, in the five years before the pandemic.

The number of major felony crimes from January to March 2023 was 8 percent lower than in the same time period in 2022, according to the M.T.A.

Mr. Neely’s killing reminded many New Yorkers of the shooting of four Black teenagers on a subway train in 1984 by Bernhard Goetz, a man who believed he was being robbed and was acquitted of attempted murder.

Ms. Ocasio-Cortez, a democratic socialist who represents Queens and the Bronx, referenced the mayor’s contentious budget cuts to schools, libraries and social services when she said that Mr. Adams had sunk to a “new low” in his response to Mr. Neely’s death.

The mayor’s mention of mental health services was “especially rich” coming from an administration that is “trying to cut the very services that could have helped him,” Ms. Ocasio-Cortez said.

Ms. Hochul, for her part, said that there should be consequences for the man who choked Mr. Neely and that “his family deserves justice.”

The city’s public advocate, Jumaane Williams, and the Rev. Al Sharpton, the civil rights leader, have called for charges against the man who used the chokehold. Maurice Mitchell, director of the Working Families Party, criticized leaders for refusing to call Mr. Neely’s death “what it is: a modern-day public lynching.”

Protesters crowded onto the subway platform at the Broadway-Lafayette station on Wednesday, chanting “housing not cops!” More protests were planned on Thursday night and Friday, including one in front of the office of Alvin L. Bragg, the Manhattan district attorney.

Charlton D’souza, president of Passengers United, an advocacy organization for transit riders, said that comments by politicians inflamed tensions and failed to address the core feeling of most subway riders who just “want to get to their destination safely.” His organization has called for adding 400 social workers to the city’s subway system.

Politicians need to “ride the system,” he said. “See what’s happening.”

For New Yorkers who spend time in the subway, the incident felt hauntingly familiar, and many felt torn over how to think about it. Kari Jonsson, 23, who works in health care and lives in the East Village, said she felt safe on the subway and that Mr. Neely’s death was a travesty. “There’s no excuse,” she said.

Maria Castaño, 64, an interior designer who lives in Brooklyn, said she viewed the man who choked Mr. Neely as a hero and Mr. Neely as the recipient of justice.

“I feel sorry for the man, but he was acting threatening,” she said.

Karim Walker, 41, often rode the trains when he was homeless for a year and a half. He encouraged New Yorkers who see a person in crisis on a train to help by calling for emergency services.

“We’re all wired to do fight or flight, but approach the situation with as much impartiality as possible,” said Mr. Walker.

Dana Rubinstein and Nate Schweber contributed reporting.