Testaverde completed 17 of 26 passes for 153 yards, two scores and two interceptions. DeAngelo Williams ran for 82 yards on 17 carries for the Panthers (5-7), who broke a five-game losing streak.
The Panthers had not won a home game since Nov. 19, 2006.
Trent Dilfer managed 14-of-29 passing with 171 yards and two touchdowns, but was also intercepted four times for the 49ers (3-9).
Martin Bashir resigns from MSNBC over Sarah Palin comments
Theater accidentally screens 'Nymphomaniac' trailer instead of Disney's 'Frozen'