Um, yes Illegal, NY 18 is age of consent... I believe NJ as well.
I don't know about NY, but I looked up NJ before posting. The NJ age of consent is actually 16. There are some exceptions - if the adult is in a position of authority over the minor child, like a teacher or supervisor or coach, then it would be illegal.
NJ is 16, NY is 17.