The Buccaneers selected University of Miami quarterback Vinny Testaverde first overall in the 1987 NFL Draft because Young was deemed a bust. Young was traded to the San Francisco 49ers on April 24, 1987 to serve as a backup to Joe Montana. 49ers coach Bill Walsh was impressed by Young's natural abilities, and believed his lackluster numbers were primarily due to the lack of talent around him in Tampa Bay.
Young played behind Montana for four years, but shone as a backup. Substituting for an injured Montana, early in the first quarter of a 1987 game against the Chicago Bears, he threw four touchdown passes in a 41–0 victory. In their 1987 divisional playoff game against the Minnesota Vikings, he replaced Montana in the second half after the team fell behind 27–10. The 49ers still lost the game, but Young had a good performance, completing 12 of 17 pass attempts for 158 yards and a touchdown, with one interception, while also leading San Francisco in rushing with 72 yards and a touchdown on six carries. On October 30, 1988, Young ran for a 49-yard, game-winning touchdown against the Vikings. He started the game out with a 73-yard touchdown pass to John Taylor, after Montana went down with an injury. The play earned the 49ers a 24–21 victory and a bit of revenge on the Vikings for their previous season's playoff loss. The win turned out to be crucial, as without it the 49ers would have finished the season 9–7 and missed the playoffs, as two other teams in their division, the Los Angeles Rams and New Orleans Saints, had 10–6 records. Instead, the 49ers won their division, earned the #2 playoff seed, and went on to win the Super Bowl.