Lions offensive coordinator Ben Johnson already has pulled out a trick play Monday night.
He called for the hook-and-ladder on third-and-12.
Jared Goff threw a 1-yard pass to Amon-Ra St. Brown, who lateraled it to Jameson Williams. Williams ran 41 yards down the sideline for a touchdown.
Williams was credited with a touchdown reception. He scored his first touchdown on a 3-yard run.
Goff had taken a 3-yard loss on a sack by Nick Bosa on the previous play. Bosa and linebacker Dee Winters both were injured on the play, though Winters quickly returned.
Goff is 6-for-6 for 89 yards.
That pulled the Lions to within 14-13 of the 49ers, but San Francisco quickly went 70 yards in seven plays. Brock Purdy threw a 40-yard pass to Ricky Pearsall to set up his 9-yard scramble for a touchdown. The 49ers are up 21-13.
Purdy is 9-for-9 for 131 yards and two touchdowns and has three carries for 12 yards and a touchdown.