It goes without saying that moonlighting in NY state is illegal if you are a resident right out of school.
Some programs do not allow moonlighting. Others discourage it and others don't have an official policy. Some institutions allow senior residents to moonlight with permission. Additional insurance is required if you do decide to moonlight.
In summary, it depends on the programs.
NB. Emailing program directors and asking directly if moonlighting is permitted is not a bad idea.