While he gave teammates positive indications in the locker room after the game, he declined to talk to reporters before walking out on crutches.
When asked if the injury was severe, coach John Harbaugh said: "I don't think so, but we'll see.
"We'll know more tomorrow when he gets the MRI, but I can't give that kind of indication right now."
Lewis was injured when he attempted to tackle former Ravens and current 49ers wide receiver Anquan Boldin, who had already made a pair of Ravens defenders miss. It seemed like Lewis' leg twisted awkwardly beneath him.
Lewis and Will Hill were in the midst of forging what the team hoped to be a long-term partnership at safety, with both signed through next season.
Reserve Brynden Trawick took his place in the base defense, with fellow reserve safety Terrence Brooks also out with a thumb injury. Veteran special teams player Anthony Levine is the only other safety on the roster.
The Ravens secondary has already seen injuries to cornerback Lardarius Webb (thigh) and Will Davis (torn ACL) this season. They lost 2013 first-round NFL draft pick Matt Elam in training camp.