A few days before, it nearly did.
By Tuesday, Mr. Cuomo had received separate assurances of support from two crucial Republicans, Mark Grisanti of Buffalo and Stephen M. Saland of Poughkeepsie, either of whose endorsement could secure passage of the historic legislation.
But neither man wanted to be the decisive 32nd vote.
The governor settled on a strategy: he informed both that another unnamed Republican would cast a yes vote, meaning that neither Mr. Grisanti nor Mr. Saland would technically be No. 32.
In the case of Mr. Grisanti, the other Republican was Mr. Saland; in the case of Mr. Saland, it was Mr. Grisanti, though Mr. Cuomo did not tell them this, respecting their wishes for confidentiality.
At the last minute, however, Mr. Grisanti wavered, fearing the bill did not have enough exemptions for religious organizations, and told Mr. Cuomo he was rethinking his position.
“Without those exemptions, I’m having a hard time supporting this measure,” he told the governor.
The governor summoned Mr. Saland and delivered the news: he might be the 32nd vote after all. Could he live with that?
Reluctantly, Mr. Cuomo said he would understand if Mr. Saland backed out of his commitment to vote yes.
Mr. Saland said he needed to think it over. After hours of anxious waiting, Mr. Cuomo heard back. If the governor needed him to be the 32nd vote, Mr. Saland told Mr. Cuomo, he would be the 32nd vote.
“I will be there for you,” Mr. Saland said.
And he was. On Friday, both Mr. Saland and Mr. Grisanti voted for the marriage bill — neither of them officially being the 32nd.
It was one of many unseen but pivotal moments that preceded the passage of the legislation by a razor-thin margin of 33-29.
Over the last several weeks, dozens of lawmakers, strategists and advocates described the closed-door meetings and tactical decisions that led to approval of same-sex marriage in New York. These accounts, including that of Mr. Saland and Mr. Grisanti, are based on those interviews, most of which were granted on the condition of anonymity to describe conversations that were intended to be confidential.
He had voted against gay marriage in 2009, and appeared ready to do so again this year. The politics did not make sense for him.
Ms. Quinn, sitting a few feet away from him, wanted him to understand the real-world consequences of that vote, especially for her and her longtime partner, Kim Catullo.
“Look,” she told him. “I get politics. You can’t look at me and say I don’t get politics and choices and comprises.”
“But this isn’t about that. This is about my life and the lives of people. If you vote no, you need to know, you are making a decision that my father and Kim’s father may never get to go their daughter’s wedding. That is the decision you are making.”
Not longer after, Mr. Robach voted against the bill.
It was a brazen request, gay marriage advocates thought.
Senator Greg Ball, a Republican, told them that if he voted to legalize same-sex marriage, he wanted assurances that national Republican leaders would campaign for him.
His top choice: former Vice President Dick Cheney.
The advocates privately chortled. Mr. Cheney had recently had major heart surgery and the possibility that he would travel to New York to endorse a state senator seemed beyond slim.
Mr. Ball, of Putnam County, eventually voted no. But he said he did not regret his request.
“As far as Cheney,” he explained by e-mail, “we suggested the need to have nationally prominent conservatives ready to support moderate Republicans willing to support either civil unions or marriage equality, in tough primaries.
”Hopefully, they listened, because some of these voting yes are going to have a tough re-election fights.”
But gay marriage advocates wanted his help lobbying Mr. Grisanti, the Republican from Buffalo.
Would the mayor call him?
Mr. Bloomberg had already bolstered the marriage campaign over the previous few months with his personal fortune and political muscle. He saw no reason to stop now.
“If this is the time, I will do it,” the mayor said. He then placed the telephone call.
The text messages were short but potent.
In 2009, moments after Senator James S. Alesi, a Republican, voted against gay marriage, he received a one-word text from a Democratic colleague, Senator Diane J. Savino, who represents parts of Staten Island and Brooklyn.
“Why?” she asked.
On June 13, a few hours after Mr. Alesi had declared his intention to reverse himself and vote for the bill this year, he received a new text from Ms. Savino.