The rise of Zohran Mamdani, a democratic socialist, has fueled a wave of spending to oppose his candidacy and back the former New York Gov. Andrew Cuomo.