QB Matt Johnson throws 5 touchdowns in 49ers' win