Mr. Mamdani, a state assemblyman and democratic socialist, won by a 12-point margin. He was declared the winner on Tuesday after ranked-choice tabulations were run.
A fire-and-brimstone preacher, he reached millions and made millions in a global enterprise before tumbling from grace over his encounters with a prostitute.