The hosts will next face Germany, 7-1 winners against Brazil at the 2014 World Cup, as goals from Lukas Klostermann and Nils Petersen gave the European side a 2-0 win over Nigeria.
Neymar and Gabriel Jesus scored twice for Brazil in their convincing victory.
Marquinhos and Luan also scored to take them into their fourth Olympic final.
Brazil have never won gold in the men’s football competition, losing in the finals in 1984, 1988 and 2012.
Tomorrow’s game will kick off at 21:30 BST and be played in front of a capacity crowd of 78,000 at the Maracana.
Brazil now have a chance to gain some measure of revenge after Germany humiliated them in the semi-finals of their home World Cup two years ago.
Rogerio Micale, coach of Brazil’s Olympic football team, said his side would cope with the expectation from the home fans.
“We are going to deal with the pressure as we have done so far,” he said. “We knew there would be a lot of pressure to win the gold medal as this would be an unprecedented achievement.
“We will work as we have done from the start and we will deliver results by striving to our absolute utmost. We will give our all – our football is not just about quality, but also perspiration which is why we can hope to make our big dream come true.”-BBC