Over tuna and turkey sandwiches, the advisers explained that New York?s Democratic governor was determined to legalize same-sex marriage and would deliver every possible Senate vote from his own party.

Would the donors win over the deciding Senate Republicans? It sounded improbable: top Republican moneymen helping a Democratic rival with one of his biggest legislative goals.

But the donors in the room ? the billionaire Paul Singer, whose son is gay, joined by the hedge fund managers Cliff Asness and Daniel Loeb ? had the influence and the money to insulate nervous senators from conservative backlash if they supported the marriage measure. And they were inclined to see the issue as one of personal freedom, consistent with their more libertarian views.

Within days, the wealthy Republicans sent back word: They were on board. Each of them cut six-figure checks to the lobbying campaign that eventually totaled more than $1 million.

Steve Cohen, the No. 2 in Mr. Cuomo?s office and a participant in the meeting, began to see a path to victory, telling a colleague, ?This might actually happen.?

The story of how same-sex marriage became legal in New York is about shifting public sentiment and individual lawmakers moved by emotional appeals from gay couples who wish to be wed.

But, behind the scenes, it was really about a Republican Party reckoning with a profoundly changing power dynamic, where Wall Street donors and gay-rights advocates demonstrated more might and muscle than a Roman Catholic hierarchy and an ineffective opposition.

And it was about a Democratic governor, himself a Catholic, who used the force of his personality and relentlessly strategic mind to persuade conflicted lawmakers to take a historic leap.

?I can help you,? Mr. Cuomo assured them in dozens of telephone calls and meetings, at times pledging to deploy his record-high popularity across the state to protect them in their districts. ?I am more of an asset than the vote will be a liability.?

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, about two years after it was rejected by the Legislature. This account is based on those interviews, most of which were granted on the condition of anonymity to describe conversations that were intended to be confidential.

?I Have to Do This?

Mr. Cuomo was diplomatic but candid with gay-rights advocates in early March when he summoned them to the Capitol?s Red Room, a ceremonial chamber with stained-glass windows and wood-paneled walls.

The advocates had contributed to the defeat of same-sex marriage in 2009, he told them, with their rampant infighting and disorganization. He had seen it firsthand, as attorney general, when organizers had given him wildly divergent advice about which senators to lobby and when, sometimes in bewildering back-to-back telephone calls. ?You can either focus on the goal, or we can spend a lot of time competing and destroying ourselves,? the governor said.

This time around, the lobbying had to be done the Cuomo way: with meticulous, top-down coordination. ?I will be personally involved,? he said.

The gay-rights advocates agreed, or at least acquiesced. Five groups pushing for same-sex marriage merged into a single coalition, hired a prominent consultant with ties to Mr. Cuomo?s office, Jennifer Cunningham, and gave themselves a new name: New Yorkers United for Marriage.

Those who veered from the script faced swift reprimand. When Assemblyman Daniel J. O?Donnell, an openly gay Democrat from Manhattan, introduced a same-sex marriage bill in May without first alerting the governor?s office, he was upbraided by Mr. Cohen. ?What do you think you?re doing?? the governor?s aide barked over the phone.

Danny Hakim contributed reporting.