"It was just time," said Odell Beckham, Jr., who caught Manning's first two scoring throws of the game. "We've been in many close games, so we knew how to lose them. We each had to find a way to win it and we did."

"We've seen it all along, I watched it when I wasn't coaching here – Eli being able to engineer drives at the end of a game," said Shurmur, a 20-year NFL coaching veteran in his first season as the team's head coach. "That's one of the things that he does extremely well and so I was happy to see that he could engineer that touchdown drive to win the game."

The last drive was vintage Manning. It was the 36th time in the regular season he has led the Giants to victory after they faced a fourth-quarter deficit or tie. That places him fourth among active quarterbacks, behind Drew Brees (45), Tom Brady (44) and Ben Roethlisberger (40). Manning has also won five postseason games with spectacular late-game performances in two NFC Championship Games and two Super Bowls.

Manning would never turn the spotlight on himself, not even after a stirring nationally-televised victory. But he clearly was very pleased. Manning had thrown only eight touchdown passes as the Giants earned just one victory in their first eight games. Reporters, former players and, at times, seemingly the majority of the football public said it was time for the Giants to replace him. Speculation had risen that rookie Kyle Lauletta might get a crack at the job Manning has held for 15 seasons.

But as all those late comebacks indicate, Manning is at his best when the situation is toughest and his prospects appear bleakest. He played efficiently against the Niners, completing 19 of 31 passes for 188 yards, three touchdowns, no interceptions, a passer rating of 110.7 and one very inspiring performance in the final minutes.

"It means a lot, and that's kind of what I told the guys this week," Manning said. "I said, 'We've worked too hard not to be rewarded with wins.' We've kind of stayed true to the course,though, and each week prepare hard, practiced well, play hard in games, and we just weren't able to get some of the outcomes or make some of the plays we needed to to win. And today we were able to do that. We scored some touchdowns early instead of settling for field goals, a couple on third-and-long, which is tough. So, that was great. That was big, and kept the game close.

"Defense did a good job getting us some turnovers and then dida great job making them settle for a field goal at the end, giving us enough time. A touchdown wins a football game, and we were able to come back and make the plays that we needed to to win."

The game was close throughout. Beckham's 10-yard touchdown reception – on third-and-eight – gave the visitors a 7-3 lead after former Giant Robbie Gould kicked a 53-yard field goal. Matt Breida's three-yard touchdown run and Gould's 36-yard three-pointer, sandwiched around Aldrick Rosas' 20-yard field goal – put the Niners ahead at halftime, 13-10.

In the third quarter, Breida and Beckham caught touchdown passes – the latter a 20-yarder on third-and-seven – and Rosas added a 31-yard field goal to create a 20-20 tie entering the final quarter.

Gould's third field goal with 2:46 remaining put San Francisco ahead, 23-20. If Manning couldn't deliver with the game on the line, the Giants' season would fall deeper into the abyss.

"It's the same thing I always tell him: 'Take me home, (number) 10," Beckham said. "He's been there plenty of times. We put together a drive."

After an incompletion to Beckham, Manning hit tight end Evan Engram up the right side for 31 yards.

"We had a play we've been working on all week and we didn't call it all game, we called it at the right time," Engram said. "Just made the play and everything opened up the way we drew it up, and just had to make the play and got us down there."

The drive slowed down because of penalties – a false start and holding by Giants offensive linemen, and holding and pass interference by the 49ers' defense. But Manning stayed focused on the task at hand and on second-and-10, completed a 23-yard pass to a crossing Saquon Barkley for a 23-yard gain to the San Francisco 12. A pass to Engram picked up nine yards before Shepard eluded rookie safety D.J. Reed, Jr. and caught Manning's pass for the game-winning touchdown.