The San Francisco 49ers finally got that much sought-after first victory of the season, and it only took playing a visiting one-win New York Giants team. The 49ers started the week slightly favored against New York, but that spread shifted as the week progressed and the Giants entered Sunday's game as three-point favorites.

Let's take a look at each of the 49ers' trips into the end zone that led to the team's 31-21 victory.

With the 49ers down 6-3 in the second quarter, rookie quarterback C.J. Beathard found wide receiver Marquise Goodwin deep and hit him for an 83-yard touchdown. The play came during a drive that followed a fumble by Giants quarterback Eli Manning on a sack by defensive end Ronald Blair. Safety Eric Reid recovered the football. The touchdown gave the 49ers a 10-6 lead.

The 49ers took the lead over the Giants for the third time on Sunday when Beathard hit tight end Garrett Celek for a 47-yard touchdown near the end of the first half. The score put the 49ers up 17-13 over the Giants, which ended up being the score headed into halftime.

The 49ers extended their lead following an 11-yard bootleg run into the end zone by Beathard. The touchdown, which concluded an 11-play, 61-yard drive, gave the 49ers a 24-13 lead early in the fourth quarter.

A 33-yard touchdown run by running back Matt Breida gave the 49ers a 31-13 lead over the Giants. The scoring play capped off a six-play, 62-yard drive with just over nine minutes left in the fourth quarter.

The victory was the 49ers' first at home since Week 1 of the 2016 season. San Francisco enters its bye week on a positive note and will not play against until the Seattle Seahawks visit Levi's Stadium on November 26.