Ehh, if you actually take a look, most NYC mayors have been “at war” with the NYPD (or, more specifically, the PBA). Look back at 1992, when they shut down the Brooklyn Bridge because they opposed the creation of a civilian oversight board. One thing to remember in all of this is that, much as they (justifiably) have the public sympathy now, they are, at bottom, a public employee union like any other. And they are currently in contract negotiations with the mayor.
It’s very true that mayors are constantly battling with - as you say - the PBA. But I haven’t seen it this bad since Dinkins, Korean Deli Boycott, etc.