Rookie Trey Lance won his first game as an NFL starting quarterback Sunday afternoon, throwing second-half touchdown passes to Elijah Mitchell and Deebo Samuel in a 23-7 victory over the Houston Texans at Santa Clara, Calif.With a sixth win in their last eight games, the 49ers (9-7) retained their hold on an NFC wild-card playoff spot with one game remaining. San Francisco will finish the regular season on the road next week against the Los Angeles Rams.The Texans (4-12), who scored first on an 8-yard TD pass from Davis Mills to Brandin Cooks and led 7-3 at halftime, saw a two-game winning streak come to an end. They close the season at home next week against the Tennessee Titans.Stepping in for Jimmy Garoppolo, who suffered ligament damage in his right thumb in last week’s loss at Tennessee, Lance was making his second start. He was at the helm of a 17-10 loss at Arizona in Week 5 when also subbing for Garoppolo, out that time with a strained calf.Lance’s 8-yard, go-ahead TD pass to Mitchell with 5:57 remaining in the third quarter came four plays after Marcell Harris intercepted a Mills pass at the San Francisco 40. A 37-yard pass-interference penalty on Chris Conley helped put the 49ers in scoring position.The Texans had a chance to tie early in the fourth quarter, but Ka’imi Fairbairn’s 45-yard field goal attempt was wide left with 12:03 remaining.Lance then threw the back-breaking TD pass after rolling to his right and finding Samuel deep down the left side on a crossing pattern. The 45-yard connection increased the San Francisco lead to 17-7 with 9:56 left.After Lance had a 3-yard TD run called back because of a holding penalty, Robbie Gould completed the 49ers’ scoring with 27- and 36-yard field goals in the final 3:23.