The Democratic race for mayor took a dramatic turn yesterday as Rep. Anthony Weiner surged to within two points of longtime front-runner Fernando Ferrer in a new poll.

The Marist College poll showed Weiner gained an astonishing 10 points in a single week, propelling him to 31 percent – right at the heels of Ferrer, who had 33 – a statistical dead heat.

Manhattan Borough President C. Virginia Fields was in third place at 17 percent, while City Council Speaker Gifford Miller trailed at 14 percent.

Five percent of likely Democratic voters remain undecided, even when pressed by pollsters to state a choice.

“He’s got the momentum going his way at the right time,” Marist poll director Lee Miringoff said about Weiner.

“It’s not like the others have tanked. What we’re seeing is that as voters began focusing on the race, the undecideds began moving Weiner’s way.”

Weiner, who turned 41 last Sunday, claimed the sensational development didn’t come as a surprise to him.

“I’ve always run underdog campaigns and I’ve always won,” he said. “In my campaign for City Council and my campaign for Congress, I went from being described as being the underdog to the winner in a matter of days.”

In 1998, Weiner won a congressional primary in his Brooklyn and Queens district by 511 votes of the 45,113 cast – with the Queens Democratic organization supporting one of his four opponents.

Analysts pointed out that Weiner’s mayoral-race gain came as his chief rival, Miller, was enmeshed in a dispute with the Campaign Finance Board that has forced him to cut back his TV ads.

Ferrer shrugged off the poll and defiantly predicted that he’d win Tuesday’s primary outright with at least 40 percent of the vote – avoiding a runoff.

“Make no mistake, I’m going to win the primary,” Ferrer said at City Hall, where he was endorsed by state Senate Minority Leader David Paterson. “My body, I feel it.”

Ferrer loyalists called on Dennis Rivera, president of the powerful hospital workers’ Local 1199, to join the Ferrer campaign as he did in 2001.

“Dennis Rivera was the first one to call me in 1989 to say that we need to do David Dinkins,” recalled Assemblyman José Rivera, the Bronx Democratic leader.

“I’m beginning to feel disappointed because I haven’t received a phone call from Dennis Rivera – a similar phone call to what we’re doing with Fernando Ferrer. But there’s still time, Dennis . . . And my phone number is 718-931-5200 in case you forgot.”

Rep. Jose Serrano said he was angry that “the people who gave us [the black-Latino-labor] coalition are walking away from it.”

Rivera still held out hope that the Rev. Al Sharpton, who returns from the Gulf Coast tonight, would provide a last-minute endorsement.