Quarterback Jimmy Garoppolo, tackle Joe Staley, and tight end George Kittle will represent the offense while defensive tackle DeForest Buckner and cornerback Richard Sherman will represent the defense.
"We voted on them on Monday," Shanahan told reporters after Friday's practice.
The five are considered by many to be the best players on the roster. Garoppolo, however, is returning from an ACL injury. Sunday will be his first regular-season action in nearly a year.
Staley is entering his 13th NFL season while Kittle, the team's Pro Bowl and record-breaking tight end, is entering his third.
Sherman heads into his second season with the 49ers and ninth in the league. He dealt with injuries throughout last season but is healthy now. Buckner, the fourth-year defensive lineman, racked up a career-high 12 sacks last year, which earned him a trip to the Pro Bowl.
More San Francisco 49ers News
Joe Staley, Vernon Davis among 49ers nominees for Hall of Fame Class of 2025 49ers list George Kittle, Deebo Samuel among 6 inactives vs. Rams Kyle Shanahan downplays impact of Jimmy Garoppolo's inside knowledge ahead of 49ers-Rams PFF's best and worst graded 49ers players vs. Rams, plus snap counts