Loading...
Brazil took the lead through Bruno Guimaraes, before Egypt responded with an early equaliser that briefly unsettled the five-time world champions.
However, highly rated young striker Endrick scored the winning goal at Huntington Bank Field, securing victory for the South American side.
The result marked another successful step in preparations for coach Carlo Ancelotti, whose team had previously recorded a 6-2 victory over the Panama national football team in Rio de Janeiro.
Brazil played without injured veteran star Neymar.
Brazil will begin its World Cup campaign in Group C against the Morocco national football team on June 13, before facing the Scotland national football team and the Haiti national football team.
Egypt, seven-time African champions, will open their tournament against the Belgium national football team on June 15, before taking on the New Zealand national football team and the Iran national football team in Group G.