Mayor Zohran Mamdani and President Donald Trump have kept a sometimes-tense relationship despite political differences.