Alonso took his first podium for Aston Martin in seven races in spectacular style by duelling with Red Bull's Perez over the final laps at Interlagos.
Perez passed the Spaniard in Turn 1 on the penultimate lap, but Alonso retaliated one lap later with an outside pass into Turn 4.
He then barely held on in a drag race to the finish line, with Perez passing him right after the chequered flag, the difference being 0.053s at the line.
Alonso admitted he thought his podium was lost when Perez steamed past on Lap 70 of 71, but explained that a late braking manoeuvre by Perez in Turn 1 opened up an opportunity for him into Turn 4 on the final lap.
"For me, it was like 30 laps that I had the pressure from Checo but when he passed me two laps to the end, I thought: 'Okay, this is gone, the podium is not possible anymore'.
"But he braked a bit late into [Turn] 1 and I said : 'Okay, I go for it into [Turn] 4.'"
The podium, backed up by fifth for Lance Stroll, was a generous reward for Aston Martin following a torrid post-summer slump, which saw it fall from third to fifth in the constructors' championship.
Alonso therefore dedicated his "phenomenal" result to everyone in the Silverstone factory trying to salvage the team's 2023 season.
"This is a phenomenal result for the team," he added. "We've been struggling for a couple of months already, especially the last two events with two retirements.
"So, this podium is for them, for everyone in the factory and we keep fighting until the last lap.
"Obviously, we're still learning about the car, these cars are so complex aerodynamically.
"We've been experimenting a little bit to find the direction for next year without forgetting that we are still competing this year. So, I'm happy for the result."