The McLaren driver had run second behind Lewis Hamilton in the early stages of the Italian GP, and looked best placed to capitalise on the world champion being given a stop-go penalty for entering a closed pitlane for new tyres.
But a well-timed pitstop by Gasly's AlphaTauri team helped the Frenchman move to the front of the field, and he was able to hold on to lead until the chequered flag after a mid-race restart.
While Sainz knew that the opportunity had been there for him to score his first victory, he was equally aware that if Hamilton had not hit trouble then the best he could have hoped for was second place anyway.
"It is incredible," he said. "I'm halfway disappointed with P2 as you would not believe that I can had a chance to fight for victory today.
"We were very, very close, but honestly with a normal race I think I would've been P2 behind Lewis because we had really, really good pace. So I think it is what we deserved."
Sainz admitted he had been surprised that the AlphaTauri had moved ahead of him during the safety car pitstop window, but recognised what good a job he had to do to recover after the restart.
"With Pierre there in front, it was like ‘woah, how could that happen?' But I guess we had a bit of bad luck with the safety car. Then we did a good job to recover it after the red flag.
"I am very happy with P2 as we've been super quick all weekend and I feel like I could dominate the midfield pretty easily today. So I have to be happy with that."
Despite missing out on the win, Sainz said that the entire McLaren team should be proud of the job it had done to have such a quick car all weekend.
"Getting back from P6 to P2 and then chasing Pierre and managing to finish three or four tenths behind at the flag, we need to be proud of that and proud of the pace of the car," he said.
"Without the red flag I think I would have finished behind Lewis today but it is what it is."