New York becomes the sixth American state to allow gay couples to wed and is the biggest by far, while the fact it has no residency requirement for a marriage licence means gay couples can travel from across America to marry there.
Gay rights advocates are hoping the vote will galvanise the movement around the US and help it regain momentum after an almost identical bill was defeated here in 2009 and other similar measures failed in recent years.
The New York bill cleared the Republican-controlled state Senate on a 33-29 vote.
Same-sex couples can begin marrying 30 days after that. Four Republicans voted for the bill and the anti-gay National Organization for Marriage said it would redouble efforts to have them voted out of office in 2012.
Senator Stephen Saland pledged the deciding vote, after voting against a similar bill in 2009, helping kill the measure and dealing a blow to the gay rights movement.
“While I understand that my vote will disappoint many, I also know my vote is a vote of conscience,” Mr Saland said. “I am doing the right thing in voting to support marriage equality.”
New York, the nation’s third most populous state, will join Connecticut, Iowa, Massachusetts, New Hampshire, Vermont and the Washington capital district in allowing same-sex couples to wed.