Don't know if it is legal for a Governor to do it per se, but the CDC can...They sourced their power to the commerce clause in the Constitution...(I also posted this link in the "Virus" thread.
https://www.cdc.gov/quarantine/aboutlawsregulationsquarantineisolation.html
So if POTUS or any Governor gets the support of the CDC it will be difficult for someone to win a suite...
That leads to the other thread: "The next civil war", and we know how serious to take that one. If anyone thinks someone is going to storm a governor's mansion, the white house or the CDC over this, they better go get their temperature checked ;-).
And before someone gets outraged and accusing me of not supporting the constitution, whether I like this or not, or you like it or not, is not the discussion, it is whether it is legal, and apparently it is...The only way you can prove it is un--Constitutional is to either do it in court, or the "next Civil War" ;-). Good luck with both options. For NYC, maybe due to the scale involved you might have a chance in the suite, on the other had, I wouldn't take the side of the bet that any judge would overturn it in what has now been called a "war".