The 49ers went ahead in a relatively tame opening quarter as Phil Dawson notched up a 32-yard field goal to put his side three in front.
Dawson then popped up again in the second to add three more points, this time by contributing a 43-yard field goal to leave the score at 6-0.
Frank Gore increased his side's lead midway through the second quarter as he completed a three-yard run to put the 49ers 13 ahead.
Greg Zuerlein provided some resistance for the Rams late on before half time as he bagged a 43-yard field goal to leave the score at 13-3 going into the interval.
Zuerlein then did it again in the third quarter, getting another field goal to bring the score to 13-6.
However, a 24-yard field goal from Dawson a few minutes later ensured that the quarter ended with the 49ers 16-6 ahead.
Brian Quick did reduce the gap between the sides, but it was not enough to deny the 49ers victory.