A contest between two New York City councilmen, Justin Brannan and Ari Kagan, will measure how strong the rightward shift is in southern Brooklyn.At a public housing complex in Coney Island, Brooklyn, a powerful Democratic councilman sought to quickly make the case for why voters should reject his opponent.“He was elected as a Democrat,” the councilman, Justin Brannan, said to a resident. “But he sold us out and became a Trump Republican.”Until recently, that simple argument would have been persuasive enough to convince most voters in this part of New York. But times have changed, and so has the political makeup of certain swaths of the city: Even though Democrats outnumber Republicans in the district by three to one, Republicans won three competitive state legislative seats in southern Brooklyn in 2022.Mr. Brannan’s opponent is Ari Kagan, a councilman who was elected as a Democrat to represent Coney Island, but is now a Republican. Because of redistricting, Mr. Brannan and Mr. Kagan have wound up contesting the same district.Mr. Kagan, who would probably have faced long odds against Mr. Brannan in a Democratic primary, won the Republican primary in June, setting up the most competitive and contentious Council election in the city. Its outcome could be a harbinger of whether recent Republican gains in southern Brooklyn might continue.It’s an area where in the 2021 mayoral election, the Republican candidate, Curtis Sliwa, drew slightly more votes than the Democrat, Eric Adams, who won by 40 percentage points citywide.Mr. Kagan has quickly adopted the talking points of his party, criticizing Mr. Brannan, who heads the Council’s Finance Committee, for failing to rein in the city’s spending and allowing the trinity of city crises — crime, migrants and homelessness — to flourish.Justin Brannan spoke to Julia Daniely while canvassing voters in Coney Island. He left the Councl’s progressive caucus this year.Paul Frangipane for The New York Times“He voted for and advocated for $1.4 billion for migrant services for the unbelievable migrant crisis, the public safety crisis, homelessness crisis, quality of life crisis, exorbitant taxation, exorbitant cost of living,” Mr. Kagan said in an interview.“He’s the chair of the Finance Committee, and he likes to say that he’s in the room where all decisions are made,” he added. “Then he has to own his own decisions.”Mr. Brannan talked about the money he has brought back to his district to renovate parks and build new schools and said Mr. Kagan is more focused on “demagoguery” than solutions.As early voting for the Nov. 7 election begins Saturday, issues such as abortion, the influx of asylum seekers and the war between Israeli and Gaza have often overshadowed more local concerns like trash pickup, the need for new parks and the poor living conditions in public housing.The district, the 47th, includes Coney Island, Bay Ridge and part of Bath Beach, and its residents are 49 percent white and 20 percent Asian. The race there is a prime example of how the nation’s divisive political debate has seeped into more local discourse, said Andrew Gounardes, a progressive Democratic state senator who represents southern Brooklyn and who endorsed Mr. Brannan.“If we’re cutting a ribbon for a new park and you’re sitting there talking about vaccines, it’s hard to bring you back from that,” Mr. Gounardes said. “Maybe we never really had you.”Mr. Brannan has nonetheless seemed to have adjusted his political stances, perhaps in recognition of the shifts among voters in South Brooklyn. He left the Council’s Progressive Caucus earlier this year because he opposed a new statement of principles that required its members to commit to reducing “the size and scope” of the Police Department.He, like Mr. Kagan, says he opposes the placement of migrant shelters in their district — a stance that has put him at odds with fellow Democrats, including Rodneyse Bichotte Hermelyn, an assemblywoman who leads the Brooklyn Democratic Party. She said that predominantly white neighborhoods like Bay Ridge in Brooklyn should have migrant shelters and criticized Mr. Brannan for not being supportive.“Justin has an opportunity to contrast himself from his Republican opponent and support a Bay Ridge shelter as a true blue progressive Democrat,” Ms. Bichotte Hermelyn said.Mr. Brannan still has broad support from reliable Democratic mainstays, including several labor unions. He is also being backed by Future NYC, a pro-business super PAC supporting moderate Democrats, which is expected to spend around $100,000 on attack ads that paint Mr. Kagan as “unhinged” and a “Democrat turned Republican.”“Justin is actually a pretty good example of someone who is a center left Democrat. He’s not for defunding the police,” said Jeff Leb, the group’s treasurer. “Ari has become a complete extremist.” Mr. Brannan has attacked Mr. Kagan for refusing to fire his campaign manager, who made derogatory statements on social media about African Americans and the L.G.B.T.Q. community. He has also criticized Mr. Kagan for shifting his stance on abortion.In the Campaign Finance Board’s voter guide, Mr. Kagan wrote that “life starts at conception,” and that abortions should only be allowed in cases of rape, incest or if the life of the mother is in danger. But in July 2022, when he was a Democrat, Mr. Kagan voted in favor of a package of bills that strengthened access to abortion and reproductive health in the wake of the Supreme Court decision to overturn Roe v. Wade.Ari Kagan, right, still has the support of Wanda Feliciano, center, even though he has switched parties.Paul Frangipane for The New York Times“I‘m still a Democrat,” Mr. Brannan said, noting Mr. Kagan’s rightward shift. “I didn’t sell my soul to keep my job.” He launched a website called the “Ari Kagan Accountability Project” to track the positions Mr. Kagan has shifted on since switching parties. Mr. Kagan said that he’s against racism and homophobia, and that his campaign manager apologized. He regrets his vote on the abortion legislation but not his shift to being a Republican — a move that may make him more attractive to the area’s Russian American voters.Gregory Davidzon, who owns Russian language media outlets where Mr. Kagan — who emigrated from Russia three decades ago — once worked, said that Mr. Kagan, like other Republican candidates in the area, would have broad support in the community.He pointed to a neighboring district encompassing Brighton Beach and Sheepshead Bay, where the sitting councilwoman, Inna Vernikov, was recently arrested after she openly displayed a gun on her hip at a pro-Palestine rally that she opposed. He said the arrest would not hurt her chances at re-election.“If it was Mickey Mouse on the ballot, it would be a vote for the Republican as well,” Mr. Davidzon said.Mr. Kagan has also won endorsements from several law enforcement unions; the Parent Party, a group that supports school choice and policing; and the conservative Asian Wave Alliance.Among the few things Mr. Brannan and Mr. Kagan agree on is that a casino shouldn’t be built in Coney Island. Each also thinks that his opponent represents his party’s more extreme positions.At a recent visit to Unity Towers, a city housing development in Coney Island, Wanda Feliciano, a former tenant leader, told Mr. Kagan that he still had her support even though he was now a Republican.“He did what he had to do for a reason,” Ms. Feliciano said, adding that she remembered how Mr. Kagan helped expedite repairs to the heating system in the buildings and brought food and supplies for residents during the pandemic.“He’s still going to do good for us no matter what party he’s in,” she added.At Carey Gardens, the public housing development that Mr. Brannan had visited, Mr. Kagan’s party switch was met with far less enthusiasm.Mr. Brannan told Star Turnage, 42, a construction worker, that her Council representative had switched parties. After she told Mr. Brannan that her bedroom wall was leaking, he informed her that Mr. Kagan had voted against the $107 billion municipal budget in June that contained funding to repair public housing.Mr. Kagan was the sole Republican to vote against the budget because he said it included “billions for migrant services” but not enough money to hire more police officers. Ms. Turnage had no doubt about her view of Republican politicians. “I would never vote for them,” she said. “They’re not for the people.” More