Mamdani, a democratic socialist in the state Assembly, will become New York City's first Muslim mayor and its first mayor of South Asian descent.