N.Y. Penal Law § 220.65
A person is guilty of criminal sale of a prescription for a controlled substance or of a controlled substance by a practitioner or pharmacist when: 1. being a practitioner, as that term is defined in section thirty-three hundred two of the public health law, he or she knowingly and unlawfully sells a prescription for a controlled substance. For the purposes of this section, a person sells a prescription for a controlled substance unlawfully when he or she does so other than in good faith in the course of his or her professional practice; or