After voting, Eric Adams leans into his appeal to working-class New Yorkers.

By turns triumphant, teary-eyed and playful, Eric Adams — the Brooklyn borough president and retired police captain who has led the recent polls in New York’s topsy-turvy mayoral race — cast his ballot early Monday morning in the Bedford-Stuyvesant section of Brooklyn.

“I am a New York story,” he told supporters who cheered “Eric! Eric!” after he voted, standing not far from the Brownsville neighborhood where he spent a childhood punctuated with economic and educational struggles, emphasizing a theme that has struck a chord with many working-class New Yorkers. “This is a moment where the little guy has won.”

The outcome of the race — a Democratic primary that will almost certainly determine New York’s next leader at a critical moment — remains very much in flux, with several other candidates within striking distance of the lead. But Mr. Adams said he had been feeling certain of victory for some time, buoyed by thoughts of his mother, who died about two months ago.

“I slept like a baby,” he said. “I heard my mother’s voice saying, ‘Baby — you got this.’”

Mr. Adams’s Primary Day tour began just blocks from the townhouse that he owns and claims as his primary residence, even though reporters have raised questions about how much time he actually spends there.

He has called the issue an attempt by rivals to distract from his Everyman appeal.

Later, outside Ebbets Field Middle School in nearby Crown Heights, Mr. Adams was approached by campaign volunteers, poll workers and passers-by for selfies. One asked for his business card “so that I can contact you.” An aide gave him his card instead.

Mr. Adams went out of his way to greet a uniformed parks worker who was cleaning a public bathroom. “How are you?” he called through the chicken-wire fence. “Keeping it clean?”

“Trying!” she said.

“That’s what happened on this trail that a lot of people don’t understand,” Mr. Adams said in an interview, frequently pausing to put voters’ queries first. “The more people who got to know me and my story the more they said, you know what, I see myself in Eric’s journey.”

Mr. Adams has drawn significant support from Black voters, but also working-class New Yorkers broadly, reflecting an upsurge in economic anxiety and concerns over crime as the city tries to recover from the pandemic.

“We sit around the table on Thanksgiving and people share their stories,” he said. “Everyone knows someone who’s been a victim of crime. Everyone knows someone who had learning disabilities, who didn’t get the resources, or on the verge of homelessness. The number of times I had to navigate, ‘Am I going to get this check in time to pay this rent?’”

After voting, Eric Adams leans into his appeal to working-class New Yorkers.