SANTA CLARA, Calif. -- — Coach Kyle Shanahan got back into the locker room after the latest win by the San Francisco 49ers just in time to see New Orleans finish off its own win a couple thousand miles away.
The Niners will have to wait at least another week to clinch a playoff spot.
Rookie Trey Lance threw two touchdown passes in the second half of his second career start, and the 49ers closed in on the playoffs with a 23-7 victory over the Houston Texans on Sunday.
"It's pretty simple for us," Shanahan said. "I think our playoffs, I kind of thought going into this game that they started today because I had a feeling that was going to go like that and it did. I'm just glad we took care of business. So we got our second playoff game next week."
The Niners can clinch their second postseason appearance in five seasons under Shanahan with a win next week against the Rams or a loss by New Orleans.
Lance got the nod for the 49ers (9-7) for the first time since Week 5 with Jimmy Garoppolo sidelined by a thumb injury and overcame an interception in the first half to lead San Francisco to the win.
Lance led the Niners to five scores on their final seven drives, starting late in the first half when he completed three passes for 56 yards in the final 38 seconds to set up Robbie Gould's 37-yard field goal on the final play of the half.
"I think I got into a better rhythm and probably settled in after that two-minute drive," Lance said. "Hopefully I can get started faster whenever that next time is."
Shanahan said he expects Garoppolo to be able to throw at practice on Wednesday and that he will have a better idea about who will start the finale then.
Lance fared much better against lesser competition in his second start than he did in a 17-10 loss to Arizona in October.
He went 16 for 23 for 249 yards with his biggest play coming in the fourth quarter when he rolled right and then threw deep over the middle to Deebo Samuel, who caught it for a 45-yard touchdown that put the Niners up 17-7.
The Texans (4-12) struggled to get much of anything going offensively and failed in their attempt at their first three-game winning streak since 2018.
"In the second half, we did some things that we've done earlier this season to lose ballgames," coach David Culley said. "We didn't protect the ball. We didn't stay consistent on offense and gave up some big plays on defense that we haven't been giving up. Those have been our Achilles heel all year long."
Davis Mills went 21 for 32 for 163 yards, one touchdown and one interception, and Houston was held to 222 yards of offense.
"We knew it was Trey's second start and we had to play a really good game to help him out," defensive end Nick Bosa said. "I think we did that."
Shanahan got startled during a break in the action late in the fourth quarter when a child ran on the field and came up to him on the sideline before being taken away by security.
"I was just looking at my call sheet and heard a soft voice in front of me saying, ‘Holy cow! Kyle Shanahan.' I didn't know if it was my son at first. It startled me a little bit. Then I realized it was a kid. I had never seen a kid run on the field. I said, ‘Wow man how did you get down here.' Security got him. I wish I was able to give him something."
The game shifted in the third quarter with a couple of big plays — and calls — for the 49ers.
It started when Marcell Harris intercepted a pass from Mills. Harris appeared to lose the ball on a fumble, but officials ruled that his forward progress was stopped.
On the next play, Terrance Mitchell was called for a 37-yard pass-interference penalty against Brandon Aiyuk to set up the Niners in the red zone. Lance finished the drive with an 8-yard TD pass to Elijah Mitchell to give San Francisco a 10-7 lead.
Mitchell finished with 21 carries for 119 yards, the rookie's fifth 100-yard game.
The Texans had two pass-interference calls go their way early in the fourth quarter to get into the red zone, but a sack on third down by Samson Ebukam and then a missed 45-yard field goal by Ka'imi Fairbairn kept San Francisco ahead 10-7.
The Texans were stagnant for most of the first half before Desmond King intercepted a pass from Lance in the second quarter.
Lance threw to George Kittle in coverage instead of an open Samuel for his second interception of the season.
The Texans, who had only one first down on their first four drives, moved the ball 80 yards by converting four third downs, taking a 7-0 lead on Mills' 8-yard TD pass to Brandin Cooks.
Mills was 3 for 3 for 47 yards and the TD on third down on that drive.
Houston S Jonathan Owens (wrist), DL Jonathan Greenard (shoulder) and DB Grayland Arnold (ankle) were hurt.
Texans: Host Tennessee on Sunday.
49ers: Visit the Los Angeles Rams on Sunday.