BBC NewsNew York holds gay marriage lottery
The lottery will select 764 couples, and opposite sex couples are eligible.
"The number of couples who want to marry on Sunday is more than the City Clerk's offices could possibly handle," Mayor Michael Bloomberg said.
The state of New York on 24 June became the largest state by far to allow same-sex nuptials.
Same-sex marriage is legal in six states and Washington DC. Eight other states offer civil unions that are legally equivalent to marriage.
New York's marriage lottery opened at noon on Tuesday and closes at the same time on Thursday, with winners to be notified a day later.
"We are going to make history on Sunday, with the eyes of the nation once again turning to New York City," Mr Bloomberg said.
"The last thing we want is for couples to wait on line for hours and hours, only to walk away upset on what was supposed to be the happiest day of their lives.
"The fairest way to determine who gets the chance to wed on Sunday and ensure everyone can properly plan for their own big day is through an even-handed lottery system.
"Nobody puts on big events like New York and we will be ready on Sunday for what will no doubt be an historic and unforgettable moment."
Since 5 July, 2,661 couples have applied to be married, and 1,728 of those are same-sex couples, the city said.
Fifty-four per cent planned to marry on Sunday 24 July, the day the law takes effect.
In New York state, couples wishing to wed must typically wait 24 hours after the issuance of the marriage licence before they are allowed to hold the marriage ceremony.
But on Sunday, more than 60 judges have volunteered to be available to hold on-the-spot hearings to waive the 24-hour waiting period, so couples can wed right away, the city said.