Moody, who returned to action after a three-week absence due to a sprained ankle, also kicked the ball for distances of 28 and 33 yards for the defending National Association champions. This is also only a second two-game winning streak this season for the 49ers (5-4).
Usually reliable, as demonstrated by his 13 field goals in 14 attempts this season before this duel, Moody missed kicks of 44, 49 and 50 yards.
The 49ers could also count on the return of running back Christian McCaffrey, sidelined since the beginning of September due to Achilles tendinitis. He rushed for 39 yards on 13 carries and caught six balls for 68 more yards.
Brock Purdy threw for 353 yards, finding rookie Ricky Pearsall 46 yards to give the receiver his first career major. George Kittle also scored a touchdown through the air.
In the loss, Baker Mayfield completed 18 of 29 passes for 116 yards and a touchdown. The Buccaneers (4-6) lost a fourth straight game.