Raphael Veiga was unmarked when he scored the opener for Palmeiras with a left-footed low shot in the penalty area in the fifth minute at Centenario Stadium in Montevideo.
Flamengo star Gabriel Barbosa scored the equalizer on a narrow angle in the 72nd minute.
The game went to extra time as regular time ended 1-1.
Following a mistake from a Flamengo player in defense, Palmeiras forward Deyverson controlled the ball to rush into the opponents' box and scored the winning goal in the 95th minute.
Palmeiras sealed the Copa Libertadores championship for the third time.
They previously won the trophy in 1999 and 2020.
After Saturday's triumph, Palmeiras will qualify for the FIFA Club World Cup.