Ed Day says he proudly remembers his days as a New York City police commander, fighting crime and helping to restore the city’s luster. But as the executive of suburban Rockland County, Mr. Day now views the city differently.

“The city I knew, the city I worked in, the city we cleaned up back in the ’90s, it’s not there anymore,” said Mr. Day, a Republican whose county is just north of the five boroughs.

He dislikes its mayor, Eric Adams, and has sued him to try to prevent the city from housing some of its overflow of asylum seekers in his county. And he characterizes the city, where a not insignificant portion of his constituents work, as a place where liberal policies have allowed it to become overrun with low-level criminals and homeless people.

Conflict between the city and the suburbs is nothing new. Ever since Long Island highways and Hudson River crossings opened up the city to a crush of workers nearly a century ago, the two sides have fought over things like school funding, taxes, tolls, bridges and tunnels.

Now, however, tensions are reaching new heights as attempts to solve the city’s most pressing problems are putting it in direct conflict with suburban residents and officials who feel that is simply not their job.

City officials have criticized opposition to its policies as selfish, one-sided, or worse, particularly on the racially fraught issue of the migrant crisis at the country’s southern border, which has led to the arrival of 74,000 asylum seekers in New York City since last spring.

Mr. Adams’s efforts to relocate some of them to hotels around the state, though at the city’s expense, has met forceful opposition, with county executives like Mr. Day suing the city and signing executive orders to try to block the migrants. Mr. Adams has countersued.

Congestion pricing, which will create a new toll for drivers entering Manhattan south of 60th Street, has been cast by New Jersey leaders as evidence of a border war. It is expected to begin as early as next spring.

A proposal by Gov. Kathy Hochul of New York to spur affordable housing around the state — helping to address a shortage in the city — was torpedoed this year by suburban lawmakers. A business payroll tax to help the Metropolitan Transportation Authority was likewise fought by suburban interests; the tax survived, but suburban businesses were exempted.

And the city’s crime rate, which rose during the pandemic after years of continuous decline, caused further anxiety as far fewer people from the suburbs were venturing into the city — a situation that allowed right-wing media and Republican candidates to portray the city as an urban cesspool rotting under Democratic leadership.

The recent choking death of a homeless man on the subway by a Long Island native only heightened this fear for some suburbanites.

The escalating tension has challenged the city’s status as the unavoidable center of political, social and cultural gravity for the tens of millions of people who live outside its five boroughs.

The friction has worsened because of the pandemic.

While the traditional drivers of migration to the suburbs — bigger homes, better schools, any kind of yard — remain, the pandemic caused people to move away from cities in many parts of the country.

New York City, for example, lost 468,200 residents between April 2020 and July 2022, roughly 5.3 percent of its population, according to census data. The suburbs and exurbs were the beneficiaries, with the pandemic’s work-from-home culture turning business districts into ghost towns.

That exodus amplified an ongoing trend of increased diversity and increasing cultural vibrancy in the suburbs, providing more options for entertainment and dining, even as the pandemic also temporarily hollowed out the very same attractions in the city.

“People don’t want to make that trip,” said Representative Josh Gottheimer, a Democrat who represents New Jersey’s northern suburbs and has led a bipartisan charge against congestion pricing. “And when you suddenly add traffic, crime, and then think about the cost of it? Just do the math.”

The congestion pricing plan — meant to ease pollution in the heart of the city and raise money for public transportation — has so inflamed suburban lawmakers in New Jersey that the state’s General Assembly, dominated by Democrats, recently passed a so-called Stay in Jersey bill, providing grants for businesses to allow their employees to work from their New Jersey homes.

The state’s Democratic governor, Phil Murphy, joined the fight, launching a billboard campaign with a Jersey-friendly slogan: “Pay congestion tax to sit in NYC traffic? Get outta here.”

Indeed, many suburban commuters stopped coming to the city as frequently or at all: An analysis of the Metropolitan Transportation Authority’s 2023 daily ridership data found that commuter rail systems were still serving fewer people compared to prepandemic levels. The Long Island Railroad saw 72 percent of prepandemic ridership on average this year.

“Suburbanites are all about personal security — as it’s reflected in crime, as it’s reflected in their finances — and when they are starting to feel threatened with the steady drumbeat of bloody headlines and lead stories, they take notice,” said Lawrence C. Levy, dean of the National Center for Suburban Studies at Hofstra University. “And even if they don’t see much of it happening around them, they’re worried that it could find them.”

That dynamic seemed to be at play in Ms. Hochul’s failure to push through a plan to build 800,000 units of affordable housing, in large part to address a chronic shortage in the city. Suburban lawmakers strenuously objected, forcing the governor to abandon her hopes of including the plan in the state budget.

While political stances used to broadly track with proximity to the city — the closer to Manhattan, the more liberal — a recent Siena College survey found that suburban New York voters were nearly as pessimistic about the direction of the state and nation as those upstate, who are generally more conservative.

That pessimism was seen in the 2022 midterms, with Republicans flipping four congressional seats in New York, in part by amplifying the city’s rise in violent crime during the pandemic and suggesting that such chaos was spilling outside the city’s borders. Crime has since receded, and New York City remains safer than most large cities in the country.

For many city residents, the narrative of a city spinning out of control is hard to square with what they see each day.

“The experiences don’t match the media narrative,” said Kaif Gilani, 26, a data analyst who lives in Brooklyn. He even disputed the notion that the suburbs were always safer than the city, saying, “I’d argue that isn’t the case.”

Ashley Alpin, 40, who has lived in New York City for six years, said that little in the city could compare with the fear she experienced during the 2007 mass shooting at Virginia Tech where she was teaching.

“It’s a real touchstone for me,” said Ms. Alpin, a librarian and mother of a 1-month-old son. “I’m like, it can happen anywhere.”

She said her parents, who live in the suburbs, as well as some friends, question why she has not moved out of the city, especially as a new parent. Homelessness, crime and migrants have come up. She detects that such probing actually translates to cultural and psychological assertions, with political overtones.

“You’re going to have to dog me pretty hard to convince me that New York City’s dead, that it has lost its shimmer,” she said.

Mr. Adams also rejected the notion that his city was somehow to blame for suburban upset, suggesting instead that their grievances belied their dependence on New York.

“We’re on the same plane: We’re the pilots,” Mr. Adams said in an interview earlier this month. “We go down, the plane goes down. We should not be praying for something to happen to the pilot. We should be praying for the pilot to land the plane.”

The pandemic also fostered anger over issues like business and school closures and masking, which had less support in the suburbs than in the city and helped win elections for Republicans like Bruce A. Blakeman, the county executive in Nassau, a traditional swing county where Democrats hope to claw back congressional seats next year.

Mr. Blakeman recently headlined a fractious rally in Manhattan on behalf of Daniel Penny, the 24-year-old former Marine accused of manslaughter in the chokehold killing of a homeless subway passenger, Jordan Neely, 30.

The killing, and a several-day pause before Mr. Penny, who hailed from Long Island, was charged in the case, served to inflame the city-suburb tensions — perhaps exacerbated by the race of those involved: Mr. Penny is white; Mr. Neely was Black.

In the case of the migrant issue, accusations of racism have also been levied at some leaders who have moved to stop Mr. Adams’s buses from leaving asylum-seekers in suburban areas.

Nantasha Williams, a Democratic city councilwoman who represents southeastern Queens, said she believes that some of the anti-New York City feeling, particularly when it comes to migrants, “might be racially and politically charged.” But she added it was disingenuous to suggest that the migrant issue was of no concern to her constituents.

“It’s irresponsible to say that there’s no impact,” she said, adding the migrant crisis is “something that everybody needs to take into consideration.”

Kevin McCaffrey, the presiding officer of the Suffolk County Legislature, says assertions that suburban officials are racially motivated are unfair, that much of the legislature is made up of second- or third-generation immigrants. Still, in late May, he recommended hiring legal counsel to see what could be done to prevent migrants from being resettled in the county.

“We are not anti-immigrant,” said Mr. McCaffrey, a Republican from Lindenhurst, N.Y., the county’s largest village. “If I was in that situation, I’d pack up my belongings and I’d have my kids on my back as well. But the fact of the matter is that we need to have laws.”

He added that he was bound to represent the views of his constituents, who had given him a clear message.

“I hear it over and over again: ‘We don’t want to be New York City,’” he said.

Historians and academics note that the city and its surrounding areas depend on cooperation with agencies like the Port Authority of New York and Jersey or on infrastructure projects like the long-sought Gateway tunnel under the Hudson River.

But on issues like congestion pricing, the divisions between suburban lifestyles and those in the city becoming glaring, said Micah Rasmussen, the director of the Rebovich Institute for New Jersey Politics at Rider University, noting that “you can’t really live in New Jersey without having a car.”

Mr. Rasmussen added that New York City’s recent economic swoon — and its ongoing efforts to return to prepandemic levels of office occupancy — may have emboldened suburban leaders.

Goliath, or Gotham, doesn’t quite feel as daunting to take on when it is struggling,” Mr. Rasmussen said. “It doesn’t quite seem quite the behemoth. We, us, New Jersey, seem more like equal partners at this point.”

Reporting was contributed by Nate Schweber and Asmaa Elkeurti in New York, and by Lauren Hard and Tracey Tully in New Jersey.