The bill passed its final hurdle in the upper house just after 6.30pm (AEST) on Thursday, after MPs backed the lower house amendment.
The amendment, made by Planning Minister Frank Sartor, frees up adoption agencies to act on the wishes of parents regarding where their children are adopted.
It was made to temper changes made in the upper house on Wednesday night, which narrowed an exemption from the Anti-Discrimination Act for faith-based adoption agencies.
MPs have been allowed a conscience vote on the historic legislation, leading to heated debate in both houses of the NSW parliament.
NSW is now the third state or territory to allow same-sex adoption, after the ACT and Western Australia.