The two Manchester sides will meet at the Bird's Nest Stadium in Beijing on Monday, 25 July as part of the pre-season International Champions Cup.
Guardiola is replacing City boss Manuel Pellegrini in the summer.
Surprise Premier League leaders Leicester will play Barcelona and Paris St-Germain as they make their debut in the invitational tournament.
The Foxes will play Celtic in Glasgow on 23 July, PSG in Los Angeles on 30 July and Barcelona in Stockholm on 3 August.
United's pre-season tour will be much shorter than in recent years.
At manager Louis van Gaal's insistence, the club will only be spending eight days in China, and play just two games.
The first of these will be against German side Borussia Dortmund, who face Liverpool in the Europa League quarter-finals next month, in Shanghai on Friday, 22 July.
Guardiola could meet old foe Jose Mourinho, who has had talks with United about taking over from Van Gaal.
The Premier League season will start later this year - on Saturday, 13 August.
Pep Guardiola will face rivals Manchester United in one of his first games as Manchester City manager.