No. There are exceptions, such as single-family houses or two-family houses where the owner doesn’t actively participate in the project.
To get a better answer, on that question and others, it’s best to contact an attorney familiar with the New York State Statutes protecting construction workers and especially one who is familiar with the New York State Labor Law Section 240 and 241.