Sorry, I agree with the NJ AG, that law does not apply to NYPD. In addition, if a PI were employed in New York and being paid in New York, it would not apply to him if he conducted inquiries in NJ, as I read it.
I'm a licensed PI in both NY and NJ, and have worked both states. I needed to be licensed by both as there is no reciprocity between the states. Even if, for example, a claim was filed in NY by a NY resident and surveillance was being done at the NY address, and the claimant traveled to NJ, the investigator would need to be licensed in both states to continue the surveillance into NJ. If that's not the case, there are a whole lot of PI firms in that area who have been getting ripped off by paying the licensing fees for both states for their employees.
The NJ law is quite explicit in defining what constitutes "private detective business." It is further explicit that engaging in such investigations without a license is a misdemeanor.
If, as NYPD contends, they were not conducting official police business, what they were doing falls under the NJ Private Detective Act of 1939 as a private detective business (assuming they were being paid while they were working there). As I pointed out, the catch is, they can not be licensed because of their concurrent employment with a law enforcement agency.
I doubt they will be charged, and the law will be ignored, but that does not mean what they did was "legal."