Flamengo stunned Brazilian Serie A leaders Cruzeiro 3-0 on Sunday, allowing Internacional to reduce the latter's advantage to six points.
Second-placed Internacional defeated Fluminense 2-1 thanks to a late strike from Valdivia - moving them to 50 points, six behind Cruzeiro in the standings.
At the Maracana, an own goal from Cruzeiro defender Dede gave Flamengo a half-time lead before Hector Canteros and Gabriel struck in the second period to secure the three points for the home side.
Flamengo entered the contest in 11th spot in the standings, 22 points adrift of Cruzeiro, but the Rio de Janeiro-based club started stronger than the league leaders before hitting the front in the 15th minute when Dede deflected a right-wing cross past his own goalkeeper.
Cruzeiro gained the ascendency as the first half wore on but butchered a number of goal-scoring opportunities and Flamengo made them pay 11 minutes after half-time.
Canteros' persistence saw him nick a long ball away from Cruzeiro goalkeeper Fabio, before he slid his shot into the net from the tightest of angles.
It was 3-0 just five minutes later when Gabriel burst into the box to thrash Alecsandro's cross past Fabio and Cruzeiro never recovered, suffering their second loss in a row after last week's 1-0 defeat to Corinthians.
In Porto Alegre, all the goals came in the second half with Alex striking first for International in the 53rd minute, delicately chipping Fluminense goalkeeper Diego Cavalieri from Andres D'Alessandro's lofted through-ball.
Fluminense equalised with four minutes left when Fred headed Diego Conca's cross inside the near post but Internacional responded almost immediately when substitute Valdivia burst onto D'Alessandro's clever pass to score.
The victory saw Internacional rise above Sao Paulo in the standings after the latter lost 1-0 at Atletico Mineiro on Sunday.
Mineiro (47 points) sit just behind third-placed Sao Paulo (49) with Gremio and Corinthians (both 46 points) in fifth and sixth respectively.
Gremio lost 2-1 at Palmeiras on Saturday, while Botafogo overcame Corinthians 1-0.
Cellar-dwellers Coritiba failed to notch a third straight win, going down 3-0 at Goias, while Vitoria moved out of the relegation zone with a 2-1 triumph at Sport Recife.
Bahia fell into the drop zone after a 1-0 loss to Chapecoense, while relegation-threatened pair Criciuma and Botafogo won.
Criciuma defeated Santos 3-0, while Atletico Paranaense won by the same margin over Figueirense.