Not smart.
It isn't a good fight to pick.
There is a legal precedent and the city actually won when there was a case where the Federal government tried to cut federal funding to a city.
It isn't a smart thing for an administration especially lacking political capital right now. He could easily lose this on the merits of the case. Let's put it this way. The Muslim ban is a much easier case for him to win and he hasn't figured that out yet...lol.
More importantly, this administration loves to run its mouth and talk tough. All of that will find it's way in front of a judge no doubt.
There is a landmark case you can look up. South Dakota vs Dole. They ruled you can not defund cities in this case. It would take legal wizardry to get this to fly and no doubt in my mind Trumps administration severely lacks this.
If he were smart he would find something bi partisan to work on and get some political capital. Nobody is impressed with all the tough talk because the government isn't a business. He is going to find this out if he hasn't already. The tail doesn't wag the dog. The people he thinks work for him do not work for him.