The South Americans were in cruise control at the break after a blistering start but a second-half fightback from the Pharaohs had the tournament favourites on the ropes
Goals from Rafael da Silva, Leandro Damiao and Neymar saw the Selecao race into a three-goal lead at half-time. Mohamed Abo Trika and Mohamed Salah hit back in the second half but it was not enough.
Mano Menezes was forced to make a change from the team that beat Team GB in a friendly six days previously, Rafael Cabral having been ruled out of the Games through injury, so backup goalkeeper Neto was promoted to make his first international start.
Brazil forced their way into the game early as Hulk weaved between four men before slipping the ball back towards Neymar whose first-time shot just whistled past Ahmed El-Shenawy’s left-hand post.
|10/11||Brazil are 10/11 with PaddyPower to win gold in the men's Olympic football
It was not long after that Egyptian chance when Brazil opened the scoring after 16 minutes, somewhat against the run of the play.
Chelsea's new signing, Oscar, changed pace and feet before playing a through ball to Rafael. The full-back took one touch on his right foot and, without looking up, rifled home with his left for his first international goal.
The Selecao quickly doubled their lead as Oscar ran onto Hulk's flick-on, then rounding El-Shenawy and playing a pass past two Egyptian defenders to Damiao who buried it into an open goal.
Within half an hour's play, it was three. Neymar showed some fancy footwork to get to the touchline before picking out Hulk on the left-hand side. The winger played the ball into the area where the 20-year-old had continued his run and headed past a helpless El-Shenawy.
There was a good chance for the Pharaohs to pull one back before half-time but Abo Trika's free kick did not have enough curl on the ball and it sailed harmlessly wide of goal.
However, Egypt came out for the second half refreshed and got themselves a foothold in the game within the first five minutes of the period.
Motaeb hit the post and after a melee in the box, the ball fell to Abo Trika who poked the ball home to give the Pharaohs a glimmer of hope.
Salah should have made it 3-2 as he tried to capitalise on Marcelo's mistake but he was always off-balance and his shot was eventually blocked by the recovering full-back before Ahmed Fathi's long-range effort just whistled past the post as Egypt continued to press without scoring.
A second goal did come as Salah did manage to make it 3-2. He turned his man inside-out before producing a curling left-footed effort past Neto.
Marcelo and substitute Ganso went close late on for Brazil as the tournament favourites just held on for the three points.