After an action-packed opening salvo, the Interlagos race fell into a mid-race slumber, but it was revived a few laps before the end by a knife-edge duel between Red Bull driver Perez and Alonso's Aston Martin.
After hounding Alonso for third place through the third stint, Perez finally found a way past in Turn 1 into the penultimate lap.
But despite the Spaniard believing his podium chance was gone, he opportunistically took advantage of Perez going deep into Turn 1 on the final tour, gaining the momentum to draft past the Mexican into Turn 4.
Perez almost repassed Alonso in a drag race towards the finish, but Alonso held on to clinch his and Aston Martin's first podium in seven races by 0.053s.
Despite Perez's own wait for another podium extending to six grands prix, he was upbeat after what he called a hard but fair battle with Alonso, which he felt was only possible with "very few" drivers on the grid.
"It took me a while to get through the Mercedes and basically that damaged my race," Perez recounted his race.
"After that we were always a bit on the backfoot with Fernando and we were chipping away towards the end. We came really close to get to the podium.
"But I have to say well done to Fernando, because it was great fight. Very fair racing.
"And that's really good, because how hard we race each other with always a lot of room, I think with very few drivers, you can do this on the grid.
"You know that Fernando will always try to play any game, but he will always be fair. It was great racing. I think whoever got the podium was well deserved, and he got it.
He added: "I don't think I could have done anything differently. I would have liked to be on the podium, it hurts losing, but I'm happy for Fernando because he did good race."
Perez extended his lead over Lewis Hamilton in the fight for second in the drivers' championship from 20 to 32 points.
Despite his disastrous Turn 1 crash in his Mexico home race and a lost podium in Sao Paulo, he feels he's finally starting to turn the corner after a confidence sapping spell that raised fresh questions over his Red Bull future.
"Definitely," he said. "I think after Qatar when I went back to the team [in Milton Keynes], we understood a lot of things we were doing wrong.
"In Austin we were compromised a bit, but since then even Mexico was quite good. I went off, but I was very close to the lead. So all in all, I think we are really making good progress.
"The pace has been there for the last few weekends, but for some reason or another, we haven't been able to put it all together. I think it's just a matter of time before it will come."
Additional reporting by Adam Cooper