EAST RUTHERFORD, N.J. — Larry Donnell’s spectacular catch over two defenders with 21 seconds remaining lifted the New York Giants to a 30-27 win over the San Francisco 49ers Sunday night, capping Eli Manning’s sensational clutch performance.

Manning had a career-best 41 completions, and his perfect throw to Donnell finished an 82-yard drive with a 12-yard touchdown. It made him the winningest quarterback in team history with 102.

Donnell was between Antoine Bethea and NaVorro Bowman, two of the 49ers’ best defenders, when he leaped to snag the pass in the back of the end zone before falling on his back.

New York (3-2) has won three straight and leads the NFC East. San Francisco (1-4) has lost four in a row and let this one slip away after an impressive comeback.

Carlos Hyde’s 2-yard run with 1:45 remaining gave the 49ers the lead. But without his best weapon, Odell Beckham Jr., for much of the final series, Manning engineered his 27th comeback victory in the fourth quarter or overtime.

Beckham set up New York’s first touchdown with a 31-yard reception down the middle. His 17-yard score late in the third quarter gave the Giants a 20-13 lead.

He left because of a hamstring injury, however, and returned only briefly on the final drive.