Perez was leading the Jeddah race comfortably when he became the first of the frontrunners to make a pitstop.
However, shortly after he emerged, a safety car period enabled other drivers to pit with a minimal loss of time.
Charles Leclerc and eventual winner Max Verstappen easily jumped him, and as Perez entered the first corner he could see Sainz emerging from the pits.
Perez stuck to the racing line, giving the Ferrari driver no room in the pit exit lane, and duly claimed third place.
Sainz complained on the radio that he had been pushed wide. The stewards discussed the matter and Perez was told to give the place back after the restart as it was deemed that Sainz was officially ahead at the safety car line.
"I was trying obviously to block him," said Perez when asked about the move on Sainz by Autosport.
"Which is allowed, in terms of you are able to cross the safety car line. So I felt everything was done in all fairness.
"The team told me to give back, so I gave it back straight after the safety car. I mean, they have more information, inside the car you don't know where you exactly are for safety car line one. So yeah, in that regard, I felt it was the right thing to do."
Perez admitted that realising that the safety car had compromised his race was a "painful" experience.
"Bad luck, bad timing. I felt I had the race pretty much under control, and then came this incident from [Nicholas] Latifi. And basically it hurt me and it just came at the wrong point of the race for me.
"I mean, as a driver, there's nothing you could do. We had everything in place, plenty of margin for the undercuts, and unfortunately, we couldn't execute what we should.
"It's a bit painful in the car, but this is racing, and going into into the race, especially these kind of races, you know that these things can happen. So yeah, a bit of bad luck."
Perez acknowledge that apart from the pitstop timing Jeddah had been his most complete event as a Red Bull driver.
"I think we did everything throughout the weekend perfectly.
"At the end behind Carlos, I think the car wasn't as good as it was on the first stint. We did some adjustment going on to the hard compound, which probably hurt us a bit.
"Then at the end, I was catching him up. And unfortunately, we had the yellow flag and then he pulled away.
"We have to keep pushing. I mean, I'm very happy for Max and the team, after the disappointment we had last weekend to get those those results is really nice.
"To be honest, I think we are on it. So we just have to keep working and see what we can improve from today. And hopefully get better next weekend."