Judge Mary Jacobson says now that the federal government recognizes gay marriages, not doing so in New Jersey would violate the state constitution.
It's not immediately clear when marriages could begin or whether the state government will appeal to a higher-level state court.
Gov. Chris Christie is opposed to gay marriage, and his administration is expected to appeal.
In Friday's ruling, the judge accepted the position of lawyers from gay rights groups that the state is now blocking citizens from receiving federal benefits.
New Jersey's top court ruled in 2006 that gay couples had to have the same legal rights as married couples. Same-sex couples in New Jersey presently can enter into civil unions.