The Rio de Janeiro club will face European champions Paris Saint-Germain for the trophy in Doha on Wednesday.
Both goals were headers from set-pieces.
Pereira outjumped the Pyramids' defence in the 24th minute to head the ball into the roof of the net.
Danilo ran in at the far post in the 52nd minute, and his downward header bounced past goalkeeper Ahmed Elsennawy.
The Intercontinental Cup brings together the winners of the six confederations' Champions League competitions in a condensed format that aims not to overshadow the 32-team Club World Cup, launched last year by FIFA and due to be held every four years.
Flamengo, winners of the Copa Libertadores just two weeks ago, beat Mexico's Cruz Azul 2-1 in the quarter-finals, dubbed the 'Derby of the Americas', on Wednesday.
As European champions, PSG qualified directly for the final.

