Jose Lopez scored in the 89th minute as Palmeiras recovered from a goal down to clinch a 2-1 away victory over Bahia in Brazil's Serie A championship on Wednesday.
Luciano Rodriguez gave the host the lead by combining with Gilberto Moraes before firing a low 20-yard drive into the far corner.
The visitor equalized just before halftime through playmaker Raphael Veiga, who sent a dipping free-kick into the top-right corner.
Lopez completed the turnaround when he latched onto Vanderlan's cross from the left wing with a diving header that rebounded in off the underside of the crossbar.
The result leaves defending champion Palmeiras just two points behind leader Botafogo with four match days remaining.
"We again showed great character to find a way to win," Lopez told reporters after the match. "We can now go back home knowing that we're still in the title race. We'll fight until the end."
In other Brazilian top-flight fixtures on Wednesday, Botafogo could only manage a 0-0 draw at Atletico Mineiro, Gremio was held to a 2-2 home draw by Juventude, Flamengo won 2-1 at Cuiaba, Sao Paulo drew 1-1 at Bragantino, and Athletico Paranaense secured a 2-0 home victory over Atletico Goianiense.