Stuart Pearce's men will face the samba stars, who are considered one of the favourites for the tournament, at Middlesbrough's Riverside Stadium on July 20.
The match will be preceded by a warm-up fixture for Hope Powell's women's team, who will play Sweden on the same date.
"I've learned a great deal about the Olympics since I was given the opportunity to lead this team and I realise just how massive an event it is going to be for the whole of Great Britain," Pearce said.
"In world football they don't come much bigger than Brazil and it should be a terrific occasion for us going into our first match.
"I think particularly with the Brazilian connections on Teesside it will be a terrific turnout again come July."
The match will be the first played by a combined Great Britain side since 1971.