Mostert, who sustained a mild MCL sprain in Week 2 against the New York Jets and missed the next two games, was ruled out in the second half with an ankle injury.
Mostert rushed for 65 yards on 17 carries before he was ruled out, catching another two passes for 11 yards. He ended the night with his second-most touches in a single game (19).
The running back walked with a limp at the end of the first half, but Mostert took the field with the 49ers to start the second. Mostert carried the ball once for one yard in the third quarter before leaving the game.
Although Mostert accrued 119 yards on 14 touches against the Miami Dolphins last week, quarterback Jimmy Garoppolo's struggles with a high ankle sprain have shown how difficult the injury is to overcome.
The 49ers' health seemed to be turning a corner on offense lately, but they were thin at running back behind Mostert on Sunday. Tevin Coleman (injured reserve) and Jeff Wilson Jr. (inactive) didn't suit up Sunday, leaving Jerick McKinnon and undrafted rookie JaMychal Hasty as the only healthy running backs against the Rams.