The Democratic Party is following a standard strategy as President Biden seeks re-election: Do not criticize him publicly under any circumstances, lest it help Donald J. Trump or one of his acolytes take back the White House for Republicans.

The one Democrat who appears to have missed the memo is Mayor Eric Adams of New York City.

Mr. Adams has taken nearly every opportunity in recent weeks to publicly blame Mr. Biden or his administration for the influx of migrants to New York from border states, many of them on buses dispatched by Republican governors.

His eagerness to point a finger at the White House has infuriated top Biden aides, who note the issue’s global complexity. At the same time, the mayor is using his platform to amplify concerns many Democrats share but will not articulate publicly because they don’t want to hurt the president.

The recent schism comes as Republicans make Mr. Biden’s immigration policy central to their efforts to dislodge him in 2024. After many Democratic candidates last year successfully used abortion rights against their Republican opponents, Mr. Biden’s nascent campaign would prefer that his allies stay on message — something Mr. Adams has shown scant willingness to do, despite once calling himself “the Biden of Brooklyn.”

Officials in New York and Washington insist that the ideologically aligned president and mayor have no personal animus toward each other. But as Mr. Adams has struggled to manage the waves of migrants being sent to New York, he has been more vocal than other mayors in the same situation — and more willing to blame Mr. Biden.

Mr. Adams said on Wednesday that it was “baffling” that Washington officials “are not understanding what this is doing to New York City.” He expressed similar sentiments last month, saying, “The president and the White House have failed New York City on this issue.”

Mr. Adams and his allies say the White House has ignored many of their entreaties, including their request that the federal government give more asylum seekers access to work permits and develop a plan to more broadly distribute migrants across the nation.

“We have reached out to the White House on a number of occasions and stated clearly the things we need,” Mr. Adams said Wednesday. “Allow people to work, which I believe that’s one of the No. 1 things we can do. Allow people to work. And do a decompression strategy at the border. We got 108,000 cities and towns and villages. Why aren’t we spreading this out throughout the entire country?”

Since becoming mayor 17 months ago on a platform of taming disorder on city streets, Mr. Adams has repeatedly broken ranks with the Democratic Party. Last year, his language on crime mirrored attacks by New York Republicans as they helped flip the House and mounted a strong challenge to Gov. Kathy Hochul.

Now, some Democrats worry that Mr. Adams’s messaging on migrants will again undercut Mr. Biden, placing the president at odds with a high-profile ally and seeming to strengthen the arguments of Republican governors like Greg Abbott of Texas and Ron DeSantis of Florida that he is weak on border security.

“Abbott and DeSantis and whoever are getting what they want: They got everybody at each other’s throats,” said the Rev. Al Sharpton, a longtime Adams ally who has tried to serve as a middleman between the mayor and the White House. “On a scale of 1 to 10, it’s a 12 in frustration, and sometimes in frustration it can come off as more adversarial than you would like.”

Mr. Biden’s aides and allies in Washington — a half dozen of whom spoke about their private discussions on the condition of anonymity — are clearly irritated with the mayor. In their view, Mr. Adams is a grandstanding opportunist, aiming to win headlines for himself without regard to the broader political implications for the president and his re-election.

Fabien Levy, a spokesman for the mayor, said in a statement that “Mayor Adams has and always will put the interest of New Yorkers first and foremost, and that’s why we’ve been asking for support for a year.” He added, “We desperately need federal and state support more than ever to quickly manage this crisis.”

Last year, some White House officials were annoyed when Mr. Adams released a public letter asking for more monkeypox vaccines and calling the White House’s approach “piecemeal” after it had already told Mr. Adams privately that he would receive the vaccine shipments he had requested.

When Mr. Abbott began busing migrants to New York from Texas border towns, Mr. Adams and his team asked the White House for federal support to house migrants, expedite their work permits and move some of them to cruise ships in the city’s harbor. The administration would often reply that many of the mayor’s requests required congressional action — which was unlikely, given the gridlock at the Capitol.

On multiple occasions, White House officials told the mayor’s staff that they hoped to continue talking about the issues privately and emphasized the need to move forward as a partnership. Instead, Mr. Adams continued to criticize the administration in public.

“He should be looking at Republicans who are purposely causing chaos for their political benefit and refusing to take any action to fix the issue,” said Pili Tobar, a former Biden administration deputy communications director who dealt with immigration.

Mr. Biden introduced legislation that would overhaul the immigration system, increasing funding for border security and providing citizenship to 11 million undocumented immigrants. But Republicans have uniformly opposed the proposals, and they have gone nowhere.

The mayor has his own calculations to make. While New York City has long prided itself on being a haven for migrants, more than 67,000 have traveled there in the past year. The city is also unique among major American cities in its legal requirement to shelter people with nowhere to live. Already facing record homelessness, the city is now housing roughly 42,400 migrants. It has run out of room at its shelters and has begun scouting alternative locations.

New York has sent migrants upstate while continuing to pay for their housing and services, temporarily housed migrants in public school gyms and floated ideas like putting tents in Central Park. The Adams administration even asked an owner of the mostly vacant Flatiron Building if there was room there. (He said no.)

Homeland Security officials in the Biden administration also privately expressed concerns last year about how cities would handle the influx of migrants from Texas and Florida.

Last summer, those officials acknowledged that New York City and Washington were already struggling, even with additional volunteers, to process hundreds of migrants bused to their cities, according to internal emails reviewed by The New York Times.

The Homeland Security Department was considering a plan in which the federal government would coordinate with local officials to fly migrants to cities, rather than releasing them along the border, and leave Mr. Abbott to continue orchestrating the surprise drop-offs.

Supporters of such government-funded flights believed they would alleviate overcrowding at the border and allow federal officials to finish the processing of migrants once they landed. But some thought there were not enough federal resources to complete the plan.

The administration instead moved ahead with an “Interior Cities Awareness Campaign,” in which the government would educate city leaders on migrants’ rights and immigration processing — but would leave municipalities to handle the drop-offs of migrants. The Biden administration has made $350 million in federal grants available to local governments grappling with the arrival of migrants; New York received $30 million.

The Adams administration says that, beyond the organizational difficulties, the migrants’ arrival will blow a $4.3 billion hole in the city budget, which was already threatened by the decline of the commercial real estate market.

Frank Carone, Mr. Adams’s former chief of staff, who is expected to lead the mayor’s re-election campaign, said it was “entirely appropriate for colleagues” to disagree on how to handle immigration.

“I would contrast that to what goes on in an oligarch state, like in Russia or China or North Korea, where I doubt very much you’re going to see dissent from Putin’s allies,” Mr. Carone said. “The president and his team realize they’re in a humanitarian crisis. And he’s doing the best he can. Unfortunately, it is falling squarely on the shoulders of New York City.”

What makes Mr. Adams’s approach so politically noteworthy — and appealing to Republicans — is that, while he is hardly the only Democrat to argue that Mr. Biden is not properly handling immigration, he is the rare one to do so repeatedly in front of television cameras.

Mr. Adams’s repeated criticism of the White House has raised his national profile — no small concern for a man whose three predecessors ran for president. His potshots appear regularly on Fox News and in other conservative news outlets, with a clear message: Even the mayor of liberal New York City has had it with Mr. Biden.

The mayor’s outspokenness has earned him the enmity of officials in the White House. Last week he was conspicuously absent from the Biden campaign’s list of surrogates, which included the mayors of Cincinnati; Richmond, Va.; and Madison, Wis.

How much political benefit Mr. Adams can gain by attacking Mr. Biden is another question.

Representative Ritchie Torres, a Bronx Democrat, said the mayor’s “sentiment is understandable and his grievance against the federal government strikes me as legitimate.”

He added: “Do I wish he were more careful in his word choice? Sure.”