Sao Paulo, who began the day top and with a chance of clinching a fourth successive title, dropped to fourth on goal difference after a 4-2 defeat away to Goias allowed Internacional and Palmeiras to overtake them.
Inter won 2-1 away to relegated Sport Recife and Palmeiras beat Atletico Mineiro 3-1 at home to join Sao Paulo on 62 points, two fewer than Flamengo.
Flamengo, whose Brazil striker Adriano burn his foot in a domestic accident on Friday, set themselves up for a fifth national title, and the first since 1992, with goals by striker Ze Roberto and defender Leo Moura.
Brazil’s most popular team are at home to Gremio at the Maracana on the final day next Sunday.
“We must continue with the same luck, the same work, the same dedication, that’s how we got here and now we mustn’t change anything. God willing, we’ll get a win at home and be champions,” said Flamengo’s Serbian midfielder Dejan Petkovic.