Scott M. Stringer, the former New York City comptroller and 2021 mayoral candidate, said on Thursday that he would form an exploratory committee and begin raising funds for a possible primary challenge against Mayor Eric Adams next year.

The move caught much of the city’s Democratic establishment by surprise and signaled the start of a combative new phase of Mr. Adams’s mayoralty, as Mr. Stringer became the first Democrat to move toward directly contesting the mayor’s re-election.

Any primary challenge promises to be exceedingly difficult. No challenger has defeated an incumbent New York City mayor in a primary since David Dinkins beat Edward I. Koch in 1989.

But few of his predecessors have been held in such low regard in polls as Mr. Adams, who is confronting the city’s budget woes, an escalating migrant crisis and an F.B.I. investigation into his campaign. Other challengers may soon follow.

In an interview, Mr. Stringer offered a dire assessment of the nation’s largest city, saying that New Yorkers were facing a “crisis of confidence” in City Hall’s ability to manage the budget and the migrant crisis.

He cast himself as a seasoned alternative, ready to replace what he derided as the mayor’s “minimalist agenda” with his own policy plans to increase affordable housing construction and ease the impact of falling revenue in city coffers.

“Let’s be blunt: Stuff ain’t getting done,” Mr. Stringer said, alluding to the mayor’s “get stuff done” mantra. “I know how to lead. I know how to manage. And I know the finances of the city like the back of my hand.”

Mr. Stringer will have to contend with his own baggage. His 2021 bid for mayor all but collapsed after a longtime associate came forward to accuse him of groping her and pressuring her to have sex when he was running for public advocate two decades earlier.

He strenuously denied the wrongdoing and has since sued the woman, Jean Kim, for defamation. But he finished that mayoral race with just 5 percent of the vote and has not held office since.

And Mr. Adams, despite his woes, enters the re-election fight with an overflowing campaign war chest, the backing of powerful labor unions and strong support from African Americans determined to deliver a second term to the city’s second Black mayor.

Still, Mr. Stringer and other Democrats eying a political opening appear to be increasingly convinced that Mr. Adams may be highly vulnerable. Public polling shows his approval rating at just 28 percent.

Other potential challengers include State Senator Jessica Ramos of Queens; former Gov. Andrew M. Cuomo; Jumaane Williams, the city’s public advocate; and Kathryn Garcia, the New York State operations director who finished second in the 2021 Democratic primary. They have all discussed potential campaigns with allies in recent weeks and may now face pressure to accelerate their plans.

Mr. Stringer, 63, said he would begin a listening and fund-raising tour around the city in the coming days. He plans to make a final decision on his candidacy in the second half of the year.

As a former state assemblyman, Manhattan borough president and comptroller, Mr. Stringer entered the 2021 race for mayor with promise. He won the support of key unions and the left-leaning Working Families Party and called on three decades’ worth of experience in public office to produce voluminous policy books.

But he struggled to gain traction in a crowded race run at the height of the pandemic — even before the sexual misconduct accusations derailed his campaign and led most of his prominent backers to desert him. (The American Federation of Teachers, the country’s second-largest teachers’ union, and the United Federation of Teachers stuck by Mr. Stringer.)

Mr. Stringer’s allies believe his experience and profile could make him a more potent foil for Mr. Adams this time around. He has more name recognition than some other potential challengers, can claim fiscal expertise after two terms as comptroller and has positioned himself politically to try to appeal both to progressives who loathe Mr. Adams and more moderate New Yorkers who may have concerns about the city’s direction.

The mayor’s opportunities for easy course correction may be few before the June 2025 primary. He has only limited control over the influx of more than 150,000 migrants from the southwestern border that has tested the city’s safety net and strained its budget. Mr. Adams rolled back some of the most unpopular cuts to the city budget, but the updated spending plan he released on Tuesday still promised another year of hard fiscal choices. Libraries remain closed on Sundays, and schools face sizable cuts.

Then there is the question of the F.B.I. inquiry into his campaign and Turkey. Mr. Adams has not been accused of wrongdoing, but the seizure of his electronic devices last year suggests a serious investigation that could result in charges against close allies, or even the mayor himself.

In the interview, Mr. Stringer said Mr. Adams deserved the benefit of the doubt around the federal investigation. But he argued that the administration was losing ground on several fronts.

“It’s become clear to me over the last two years that New York City needs a new direction,” Mr. Stringer said. “We cannot move the city forward with what is a minimalist agenda.”

He conceded that the flow of migrants had created a substantial financial burden for the city. But he said he was worried that Mr. Adams’s hardball approach toward persuading the federal and state governments to take more responsibility had backfired, antagonizing the White House.

“This is not a me, myself and I situation,” he said. “This is about how you forge alliances.”

He called the mayor’s budget approach confounding, arguing that Mr. Adams had spent weeks in “a budget dance with himself,” threatening deep cuts that he later walked back, instead of working with the City Council to find a sustainable path forward.

Mr. Stringer deplored the sharp decline in new housing construction. He said he would prioritize creating affordable housing, suggesting he had a 47-page housing plan ready to go from his 2021 campaign. Mr. Adams’s own ambitious housing plans have been stymied by an impasse in Albany.

Mr. Stringer, whose 2021 campaign called for redirecting $1 billion in police funding, even found room to criticize Mr. Adams’s signature priority: public safety. He attributed a decline in major crimes like shootings and murders to national trends, and argued that the city was spending a fortune on officers’ overtime in exchange for merely “flatlining” in key crime metrics.

In recent weeks, Mr. Stringer has hinted of his interest in an eventual run. Notably, he hosted a reunion of former aides earlier this month; several left with the distinct impression he was running. He has already scheduled several fund-raisers.

His early action would seem to position him as a contender in a special election if Mr. Adams were to be indicted and resign.

“This is no longer a time to play checkers, this is a time to play strategic chess,” Mr. Stringer said. “We need a mayor who knows how to govern and lead but also has a real understanding of how government works.”