MANCHESTER, N.H. — For weeks this winter, as Newt Gingrich’s presidential hopes faltered under the weight of millions of dollars in attack ads paid for by backers of Mitt Romney, a small group of Gingrich supporters quietly lobbied for help from one of the richest men in America: Sheldon Adelson, a billionaire casino owner and Mr. Gingrich’s longtime friend and patron.

Mr. Romney’s supporters were also calling, imploring Mr. Adelson to stay out of the race.

By the time Mr. Gingrich limped into New Hampshire, some of his top backers had given up on Mr. Adelson and begun prospecting elsewhere, including among erstwhile supporters of Gov. Rick Perry of Texas, to finance a counterattack.

But on Friday, the cavalry arrived: a $5 million check from Mr. Adelson to Winning Our Future, a “super PAC” that supports Mr. Gingrich. By Monday morning, the group had reserved more than $3.4 million in advertising time in South Carolina, a huge sum in a state where the airwaves come cheap and the primary is 11 days away. The group is planning to air portions of a movie critical of Mr. Romney’s time at Bain Capital, the private equity firm he helped found.

The last-minute injection underscores how the 2010 landmark Supreme Court ruling on campaign finance has made it possible for a wealthy individual to influence an election. Mr. Adelson’s contribution to the super PAC is 1,000 times the $5,000 he could legally give directly to Mr. Gingrich’s campaign this year.