Judge Freda L. Wolfson said in the ruling that the law does not violate free speech or religious protection.
The law "on its face does not target speech, and "counseling" is not entitled to special constitutional protection merely because it is primarily carried out through talk therapy," Wolfson wrote.
Gov. Chris Christie signed a ban on the controversial practice, known as gay conversion therapy, in August.
Christie, a Republican, said health risks of trying to change a child's sexual orientation, identified by the American Psychological Association, usurped concerns about parental choice.
Christie, however, said it is an area where the government should "tread carefully."
California was the first, and the only other, state to ban the practice. In August, a federal appeals court upheld the state's statute.
The New Jersey lawsuit, filed by two therapists, the National Association for Research and Therapy of Homosexuality and the American Association of Christian Counselors, argued the law violates the right to free speech because counselors are barred from talking about conversion therapy.
Plaintiffs also argued that it infringed upon the right to exercise religion and parents to "direct the upbringing and education of their children according to their sincerely held religious beliefs."
Demetrios K. Stratis, a lawyer for the plaintiffs, did not return a phone call seeking comment.
Wolfson ruled the plaintiffs' argument could be stretched to mean that regulation of any professional counseling could violate First Amendment rights, a result that "runs counter to the longstanding principle that a state generally may enact laws rationally regulating professionals, including those providing medicine and mental health services," she wrote.
Wolfson granted a motion to allow Garden State Equality to intervene in the lawsuit. Its president, Troy Stevenson, said in a statement the ruling is a "huge victory for New Jersey youth."
A New Jersey couple filed a separate lawsuit Monday claiming their constitutional rights are being violated because they cannot seek gay conversion therapy for their 15-year-old son.
The couple said their right to equal protection is being violated because the law is "denying minors the opportunity to pursue a particular course of action that can help them address the conflicts between their religious and moral values and same-sex attractions, behaviors or identity."
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.