Mamdani's win came in the face of fierce attacks on his policies and Muslim heritage from President Donald Trump.