By Vic Tafur, Nate Atkins, Matt Barrows and Jenna West

The San Francisco 49ers escaped the Los Angeles Rams in overtime, 26-23, to take sole possession of first place in the NFC West.

The 49ers were led by backup quarterback Mac Jones, with starter Brock Purdy out after aggravating a toe injury on Sunday. They scored touchdowns on their first two possessions of the game and then relied on field goals to hold onto their lead throughout the night.

49ers rookie defensive tackle Alfred Collins had a game-saving forced fumble and recovery when he knocked the ball loose from Rams running back Kyren Williams just before Williams crossed the goal line with 1:07 left in the fourth quarter. The Rams trailed 23-20 at the time and later kicked a game-tying field goal to send it to overtime.

Jones got the 49ers down the field to set up what would be the game-winning 41-yard field goal from kicker Eddy Pineiro. The Rams failed to score on their final possession when Williams got stuffed on fourth-and-1 to seal the 49ers’ win.

Mac Jones steps up

Jones completed his first eight passes, and the 49ers jumped out to a 14-0 lead a minute into the second quarter.

Jones signed with the 49ers because he always wanted to play in coach Kyle Shanahan’s system, and had already had two wins in his first two starts for an injured Purdy this season. But Jones was at his best Thursday night, completing every kind of pass and finding former New England Patriots teammate Kendrick Bourne and Christian McCaffrey on third downs. Bourne finished with 10 catches, a week after he had three drops in the loss to the Jacksonville Jaguars.

Jones also seemed to aggravate a knee injury in the third quarter, but walked it off and led the 49ers on a drive that started on their own 2-yard line late in the fourth quarter. Pineiro made a 59-yard field goal to give the 49ers a 23-20 lead with 2:52 left.

Jones went 33 of 49 with 342 passing yards and two touchdowns. — Vic Tafur, 49ers senior writer

Rams’ secondary has troubling game

The Rams entered with a top-10 defense by nearly every metric, but had shown leakage in one specific area: guarding wide receivers. Big plays on the perimeter the past two weeks after Ahkello Witherspoon went to injured reserve were a sign, and on Thursday night, it meant Bourne going for a career day with 10 catches for 142 yards on 11 targets.

What was different than the past two weeks is that much of Bourne’s activity came in the slot, with several catches against Quentin Lake, often a star in the Rams’ defensive backfield. But Lake is better when his role is blurred between the nickel and the safety spot, and he was locked in man assignments on Bourne a little too often.

The 49ers used a smart approach by throwing quickly with Jones against one of the best pass rushes in the NFL. The Rams built their defense with resources around the front four, and that’s even more true with Witherspoon down. But teams throwing quickly can be an antidote with the right personnel packages and play designs, and Shanahan often has a way of exploiting those in these matchups. — Nate Atkins, Rams senior writer

49ers plagued by more injuries

The 49ers’ D-line is dwindling. Already playing without Kevin Givens, who is on injured reserve with a pectoral injury, Nick Bosa (IR, ACL), and Robert Beal Jr. (ankle), the team lost Kalia Davis to a hand injury and Yetur Gross-Matos to a hamstring strain during Thursday’s game. Both started against the Rams. Meanwhile, rookie defensive tackle CJ West played the contest with a broken thumb he suffered in Week 3. The team also waived defensive tackle Jordan Jefferson before the game to make room for quarterback Adrian Martinez on the 53-man roster.

After losing Bosa in Week 3, the 49ers said they’d do their due diligence as far as trading for another pass rusher. Thursday’s injuries, as well as the team’s tepid four-man pass rush, might put more pressure on the team to add more bodies. Although Bryce Huff sacked Stafford in the first quarter, Stafford mostly operated in a comfortable pocket, and he went 30-of-47 for 389 yards and three touchdowns. — Matt Barrows, 49ers senior writer

Rams lean all the way in on Matthew Stafford

Coming off Matthew Stafford’s career-best game in yardage as a Ram, coach Sean McVay leaned hard into his star quarterback’s abilities. After an attempt at balance in the game script that ended with a Blake Corum fumble, the Rams went almost exclusively pass until late in the fourth quarter.

Stafford finished with 47 attempts, versus just 14 called runs. But the pass did open the run up eventually, as Williams averaged 4.6 yards per carry with 14 carries for 65 yards, and he found life as a receiver by catching two touchdown passes on schemed-open designs. But his fumble at the goal line with 1:02 remaining really stung.

Like the blocked kicks, fumbles are starting to hurt the Rams, as their running backs have lost three in the past two weeks, including two from Williams. It’s a sting to a run game that has otherwise been one of the best in the NFL on a yardage and efficiency basis. But it shows why McVay trusts the passing game more in some moments. — Atkins

SF’s questions at QB

Similar to Week 4, the 49ers’ starting quarterback for next week’s game in Tampa Bay might hinge on who’s healthier — Jones or Purdy. San Francisco scratched Purdy from the lineup Wednesday, three days after he aggravated the toe injury initially suffered in Week 1. Purdy said during the week that his big toe doesn’t feel as bad as it did after the Week 1 game against the Seattle Seahawks, but he did not practice in the run-up to Thursday’s game.

Cameras caught trainers working on Jones’ right wrist/forearm area on the sideline. Jones limped at one point in the third quarter and had to be helped off the field later in the quarter after a hit by Rams edge rusher Byron Young. Jones played with a brace on the knee throughout the game.

The only other QB option at the moment is Martinez, who’s never attempted a regular-season NFL pass. The 49ers promoted Martinez to the 53-man roster before Thursday’s game. — Barrows

(Photo: Gary A. Vasquez / Imagn Images)