It's not always that straightforward. A lot of times local politics don't reflect the same as national. There are other issues not related to crime stats to consider too. Bloomberg alienated the police and the teachers, and pulled some shady stuff to make himself eligible for a third term. Most people don't like de blasio much either, but voted for him because he was supposed to correct some of the issues, like for instance the city is still paying back pay this year to people because of problems under Bloomberg and how he supposedly balanced the budget.
NYC had republican mayors for 5 terms straight I think, but there were still problems is all I'm saying. But you also have to understand that even republicans in NY are not the same as republicans in the rest of the country. Iirc Rudy was technically a liberal republican? and Bloomberg of course called himself a republican and then ran for president as a democrat, which just shows you how these things don't exactly line up.
I just think it may be a little more complicated than red and blue when you're looking at major cities and the issues they face in general.