The campaigns paused Wednesday as the city observed the anniversary of the Sept. 11, 2001, terrorist attacks. Later this week, election officials will recount all the ballots cast.
Bloomberg has led New York for 12 years. During that time, crime fell but income inequality rose.
De Blasio campaigned with a "tale of two cities" theme meant to appeal to the middle and lower class.
Weiner had been leading in the polls until a gossip website revealed that he used the online handle Carlos Danger to continue to send X-rated messages to women, even after he resigned from Congress in 2011 for similar behavior.
Another scandal-scarred politician, Eliot Spitzer, who resigned as New York's governor in 2008 after paying for sex with prostitutes, tried to run a self-financed campaign for the lesser office of city comptroller. But he lost to Manhattan Borough President Scott Stringer, 52 percent to 48 percent.
While the city's registered Democrats outnumber Republicans 6 to 1, the Republican Party's recent success in mayoral elections has been largely attributed to a crime epidemic, the aftermath of the Sept. 11 attacks or other extraordinary circumstances.
De Blasio, 52, has fashioned himself as the cleanest break from the Bloomberg years. He worked in Bill Clinton's White House and Hillary Rodham Clinton's Senate campaign before being elected to the city council and then public advocate.
___
Associated Press writer Jonathan Lemire contributed.