Yamaha's Quartararo qualified a career-worst 23rd in the damp Q1 session, but put on a sensational fightback in the early stages of the 12-lap sprint at Jerez on Saturday.
Leaping up to 11th on the opening lap, Quartararo was in the points in ninth on the third tour and vaulted up to third after a spate of crashes in the latter stages.
Quartararo fended off KTM wildcard Pedrosa by 0.050 seconds to score a first podium since the Indonesian Grand Prix last October.
However, Quartararo was later found to have broken the minimum tyre pressure rule and has been handed an eight-second time penalty.
This drops Quartararo down to fifth and promotes Pedrosa to the podium, marking his first rostrum of any kind since he won the Valencia GP in 2017 when he was a full-time racer.
Ahead of this season, the penalty for riding underneath the minimum tyre pressure of 1.8 bar for more than 30% of a sprint and 60% of a grand prix was meant to be disqualification.
However, this was tweaked earlier this year so that the penalty was eight seconds for a sprint in fraction and 16s in the grand prix.
Quartararo has become the first rider this season to be penalised for breaking the minimum tyre pressure rule.
Trackhouse Racing Aprilia rider Raul Fernandez has also been penalised eight seconds for breaking the minimum tyre pressure rule, which promotes Marc Marquez to sixth after his chaotic race. Alex Rins and Jack Miller were each handed eight-second penalties too.
While it has not been confirmed if it was front or rear tyre pressure that was out of the minimum limit, all penalties for the infraction last year were down to front pressures.
If it was the front, due to the 2021 world champion's starting position, it's likely his Yamaha crew set his tyre pressures for the 12-lap sprint in anticipation of him circulating in the pack for the duration and thus experiencing a quick increase in pressure that would have ensured he avoided a penalty.
Pedrosa's podium return comes a year on from his rides to sixth in the sprint and seventh in the grand prix as a wildcard for KTM at Jerez.
At the San Marino GP, he finished fourth in both races.
Speaking about his 2024 Spanish GP sprint, Pedrosa said: "I was around P13 more or less and I was already behind Fabio.
"Then I wanted to overtake him immediately in the first two laps but I saw one crash, then in the next lap another crash, then in another lap another crash.
"Then I said 'Okay maybe just don't push too much because maybe the tyres are not ready and the track is tricky'.
"So, I go step by step. So I stay behind Fabio for the race but every two or three laps, two guys off.
"Three guys off. Another guy off after. I didn't know my position anymore because when I was passing in the straight line I was trying to overtake Fabio and I always pass on this side and I don't see very well my board.
"So, in the last lap we didn't know we were P3, P4. I thought we were P6, P7."