United had already arranged matches against Club America, San Jose Earthquakes, AC Milan, Liverpool and Real Madrid during a summer tour of the United States.
The meeting with Bayern will come after that tour is completed, with Jose Mourinho's side travelling to the Allianz Arena for their final warm-up game.
"The team are facing some of the world's toughest opponents over the course of pre-season, in top-class stadiums which will allow a significant number of our supporters to get closer to the team they love," United executive vice-chairman Ed Woodward told the club's official website.
"The competitive feel throughout the summer programme will provide a great platform for the squad, giving them the best possible preparation ahead of the new campaign."
It will be the first fixture between the two sides since April 2014, when David Moyes's United team were knocked out by Bayern in the quarter-finals of the Champions League.