Democratic mayoral candidate Anthony Weiner has surged ahead of his opponents in a new NBC 4 New York/Wall Street Journal poll, transforming himself in just a few weeks from disgraced has-been to mayoral front-runner.

Weiner, who entered the race two years after resigning his congressional seat amid a sexting scandal, now leads City Council Speaker Christine Quinn 25 percent to 20 percent among registered Democrats, the poll by Marist found. That's a flip-flop from the last survey in May, when Quinn, the longtime front-runner, led Weiner 24 percent to 19 percent.

And a runoff in the Democratic contest seems increasingly likely -- no candidate appears close to capturing the 40 percent needed on Sept. 10, which would force a second contest between the top two finishers.

The poll shows that, in those scenarios, Weiner does not lead, but has gained a great deal of ground since the previous survey. In a runoff between Quinn and Weiner, she beats him 44 percent to 42 percent, with 14 percent undecided. That's a change from last month's poll that found 48 percent for Quinn, 33 percent for Weiner and 18 percent undecided.

In a runoff scenario between Quinn and former Comptroller Bill Thompson, 42 percent backed Quinn and 40 percent support Thompson, with 18 percent undecided. And if Thompson were to face Weiner, he would narrowly beat the former congressman by 42 percent to 41 percent, with 18 percent undecided.

Another good sign for Weiner is the number of registered New York voters who said they might vote for Weiner. Forty-nine percent said they’d consider it, up from 40 percent two months ago, before Weiner entered the race. Those who said they wouldn’t consider voting for him dropped from 52 percent to 45 percent.

The next closest contender in the Democratic primary is Thompson, with 13 percent of registered Democrats saying they'd vote for him, up 2 percentage points from May. Public Advocate Bill de Blasio follows with 10 percent, who dropped 2 points. Then comes current Comptroller John Liu at 8 percent, Staten Island minister Erick Salgado at 2 percent and former City Councilman Sal Albanese at 1 percent.

With potential votes spread out over so many candidates, and turnout in the primary expected to be relatively low, the race remains statistically wide open. Many Democrats — 18 percent — remain undecided, and 61 percent who have a choice indicated that they weren’t firmly committed to it.

But Weiner appears to be enjoying the clearest advantage so far. His early campaigning, in which he’s portrayed himself as a middle class guy from Brooklyn, has included frequent apologies about his misdeeds. That seems to have made him more acceptable to New York voters, said Lee Miringoff, director of the Marist College Institute for Public Opinion.

"The race changed when he got into the race, and he’s been able to survive returning to electoral politics, at least to this point," Miringoff said.

At the same time, Quinn, who holds the most powerful office of the candidates, has suffered an erosion of support: 57 percent of Democrats polled they had a good impression of her, down from 60 percent in May, the poll shows. Meanwhile, her negative rating has inched upward, from 26 percent in May to 29 percent now.

Mike Morey, a Quinn spokesman, said: "We fully expect the polls to fluctuate throughout the campaign, but we are confident that on Election Day when voters have to decide who they want to lead this city, they will choose someone who has demonstrated the ability to lead and deliver."

Weiner, meanwhile, saw his favorability rating among Democrats jump from 44 percent to 52 percent. His negative rating dropped from 44 percent to 36 percent.

Weiner said Tuesday that "in many ways, it doesn't change anything. We're going to keep talking about ideas for the middle class."

Thompson also enjoyed a favorability boost, jumping from 52 percent to 60 percent.

Miringoff attributed the Weiner-Quinn reversal to the fact that Quinn, as the early front-runner, became the target of her rivals’ criticism as she tried to find the right balance of allegiance to — and independence from — outgoing mayor Michael Bloomberg. That drew some negative attention from Weiner.

Weiner resigned from his Brooklyn congressional seat in June 2011 after using Twitter to send provocative photos of himself to women. When the exchanges became public, he claimed he’d been hacked. He eventually confessed and went into virtual hiding with his wife, Huma Abedin, a senior adviser to Hillary Clinton. At the time, Abedin was pregnant with their first child.

She has emerged as a key player in her husband's mayoral campaign.

Weiner has long desired the city's top office. He ran in 2005, and nearly forced a runoff against Fernando Ferrer, but conceded in the name of party solidarity. He planned to run again in 2009, and was considered a leading contender, but dropped out after Bloomberg chose to run for a third term.

Prior to his unraveling, Weiner had begun to plan for a 2013 campaign. He began with more than $4 million in his campaign account. And, for good or ill, lots of New Yorkers recognize his name.

Weiner now leads Quinn in three of the five boroughs, the exception being the Bronx, where they tied, and Manhattan, Quinn's home, where she leads, according to the poll.

Weiner also outpolled Quinn among men (29 percent to 19 percent) and women (22 percent to 21 percent).

Among registered Republicans, former MTA chairman Joseph Lhota leads his closest competitor, billionaire Republican businessman John Catsimatidis, 28 percent to 21 percent. Homelessness-services nonprofit head George McDonald is in third with 10 percent. Forty percent of Republican voters remain undecided.

The poll was conducted from June 17 to June 21. The respondents included 1,118 registered voters, with a margin of error of plus or minus 3 percentage points. Of those respondents, 689 were registered Democrats, with results from that pool carrying a margin of error of plus or minus 4 percentage points. A much smaller number of registered Republicans were questioned, so the margin of error is higher, plus or minus 9 percentage points.