After the 54-24 vote in the Assembly, the bill heads to Gov. Chris Christie, who can sign it, veto it or conditionally veto it - saying he'll approve it only if lawmakers make changes.
The state Senate had already approved the bill.
Lawmakers hope that giving intravenous drug users more access to clean needles will help stem the spread of HIV and other blood-borne illnesses.
Critics fear it might legitimize use of illegal drugs.
In 2008, New Jersey became the last state to offer addicts a legal way to get clean needles when a needle-exchange approved two years earlier began running. Other states already had exchanges, legal sales without prescriptions - or both.
Advocates say the needle sale bill would be more helpful than the limited exchanges, which are allowed in only six cities.
"This is the first time the New Jersey legislature has voted to join the overwhelming majority of other states in allowing limited sales of syringes without a prescription," said Roseanne Scotti, New Jersey State Director for Drug Policy Alliance. "This legislation has overwhelming support from the medical and public health community."