SANTA CLARA, Calif. -- Jimmy Garoppolo led one final scoring drive in the closing seconds to cap a fantastic first home start, Robbie Gould kicked a game-winning 45-yard field goal as time expired, and the San Francisco 49ers topped the Tennessee Titans 25-23 on Sunday.
Garoppolo threw for a career-high 381 yards and a touchdown during a dominant day to give the 49ers (4-10) a three-game winning streak in a lost season. And Tom Brady's former backup showed he could do it at home as well as on the road -- and against a playoff contender, no less -- outdueling Marcus Mariota down the stretch as the teams traded field goals.
Gould kicked three of his six field goals over the final nine minutes: 50, 48 and 45 yards and has now gone 20 consecutive without a miss.
Gould put the Niners out front on a 48-yarder with 3:08 remaining. Mariota then drove the Titans (8-6) to a lead as Ryan Succop kicked a 50-yard field goal with 1:07 to play, then Garoppolo and the San Francisco offense got one last shot.
It took three tries this season, and first-year coach Kyle Shanahan finally found his reliable, playmaking quarterback after acquiring Garoppolo from New England at the October trade deadline. Garoppolo showed that in 67 seconds when forced into late action in a loss to Seattle three weeks ago at Levi's Stadium, then in back-to-back road games before shining again Sunday.
Marquise Goodwin made 10 catches for 114 yards and Garoppolo completed 31 of 43 passes to go over 300 yards passing for the second straight game after last week's win at Houston.
Mariota put Tennessee ahead on an 8-yard touchdown pass to Rishard Matthews early in the fourth as the Titans rallied back from an early 13-point deficit.
The 49ers were in good position the ensuing possession before Garoppolo was sacked by Wesley Woodyard for a 10-yard loss. Then, Gould converted a 50-yarder.
Tennessee came out of intermission a new team, totaling 22 offensive plays to San Francisco's five in the third quarter.
Garoppolo became the first 49ers quarterback since the merger in 1970 to win each of his first three starts and just the second QB to do so in franchise history. Y.A. Tittle did so spanning the 1951-52 seasons.
He threw a 5-yard touchdown pass in the second quarter to tight end Garrett Celek -- whose great play in recent weeks has earned the nickname of "Celek Time." Celek later had a 41-yard catch.
Garoppolo didn't even have Trent Brown to block for him after the right tackle went on injured reserve with a right shoulder injury that will require surgery. Mariota threw a 4-yard TD pass to former 49er Delanie Walker late in the first half to keep the Titans close.
Garoppolo was 5 of 6 passing on his opening possession as San Francisco mixed its play calls well to catch the stingy Titans defense off guard. Gould's 38-yarder capped the 12-play, 64-yard initial drive. Gould hit a 48-yarder late in the first and then kicked one from 28 yards just before halftime.
The Titans played a second straight road game against the NFC West after losing last week to the Cardinals and staying in Arizona for the week of practice.
Their first visit to Levi's Stadium -- Tennessee last played the Niners on the road at Candlestick in November 2009 -- began slowly, the team's second straight week playing a stadium for the initial time.
Mariota, in the midst of one of the worst stretches of his three-year career, threw for 241 yards completing 23 of 33 passes.
Tennessee's typically tough defense was a far cry from that dominant unit in the first half.
Garoppolo threw for 189 yards and the Niners outgained the Titans 219-136 in the first half. The 49ers didn't punt until more than midway through the third quarter.
Last week, the Titans allowed only four field goals, the second time this season they'd done so. From Week 5, Tennessee had been allowing only 295.1 yards per game.
Titans: CB Logan Ryan sustained an ankle injury in the second quarter.
49ers: WR Aldrick Robinson suffered a concussion in the first quarter. He went to the locker room with head and wrist injuries after he was hit hard by Titans cornerback Adoree' Jackson along the Tennessee sideline. Robinson was stretching out trying to make a catch when he got slammed and went down for several minutes with 5:24 to go in the opening quarter.
Titans: Host Rams next Sunday and home the final two weeks.
49ers: Host Jaguars next Sunday.
For more NFL coverage: http://www.pro32.ap.org and http://www.twitter.com/AP-NFL
Eds: This version corrects Titans record.
Arizona Cardinals' DeAndre Hopkins expects relationship with Kyler Murray to flourish
Cardinals receiver DeAndre Hopkins says he expects that he and his new quarterback, Kyler Murray, will become close out of necessity.
Gronk hilariously wishes Brady a happy birthday
Rob Gronkowski takes a moment to wish his quarterback, Tom Brady, a happy 43rd birthday.
Chargers' Joey Bosa thankful, relieved with record extension
Joey Bosa said Monday his record-breaking contract extension came together faster than he expected.
QB Aaron Rodgers shies away from conjecture about Packers tenure: 'Don't know what the future holds'
Packers quarterback Aaron Rodgers reiterated Monday that he doesn't "know what the future holds" in terms of his time in Green Bay, but he once again acknowledged, "I think if I retire on the team's timeline, then all is well."
Seattle Seahawks monitoring Antonio Brown situation, open to Josh Gordon return, Pete Carroll says
Pete Carroll on Monday acknowledged the Seahawks have interest in Antonio Brown, although he noted the wide receiver's "complex" situation, and said the team is "very open" to a reunion with Josh Gordon.
Guard Brian Winters joins Buffalo Bills on one-year deal after Jets release, source says
Brian Winters has agreed to a one-year contract with the Buffalo Bills just one day after he was released by the Jets, a source told ESPN's Adam Schefter.