The NSW upper house has passed a motion calling on the federal government to allow gay marriage, despite a Liberal MP saying that change could lead to polygamy.

Greens MP Cate Faehrmann's private members' motion passed 22 votes to 16 in the Legislative Council, with both major parties allowing a conscience vote.

Cate Faehrmann . . . The Upper House backed her motion to support gay marriage in a historic vote. Credit:Wolter Peeters

NSW has now joined Tasmania and the ACT in having a parliamentary chamber call for the 1961 commonwealth Marriage Act to be amended to allow same-sex marriage.

Shortly before the vote, Ms Faehrmann likened a ban on gay marriage to the 1950s laws prohibiting Aboriginal men from marrying white women.