The draw means either Ronaldo and the 2016 European champions or four-time World Cup winners Italy will fail to make the tournament next year.
Italy finished as runners-up to Switzerland in the group stage of qualifying, while Portugal were pipped to the top spot in their group after a home defeat to Serbia, meaning both teams have to go through the new playoff system if they are to be at the finals in Qatar in a year.
Portugal will be at home to Turkey in the semifinals, while Italy will host North Macedonia. The winners of those two semifinals will meet for one place at the World Cup. Portugal or Turkey will be at home in the final.
Speaking after the draw, Portugal coach Fernando Santos said: "I have complete confidence that we will be at the World Cup in Qatar. It's not worth talking about Italy. We have to focus, first of all, on beating Turkey.
"This is the most important game for us in order to be in the [playoff] final and win that, which is our main objective. Regarding the draw, it is what it is, there's no point in discussing it further.
"There were positive things, we will be playing at home and will have the opportunity to play in front of our fans if we reach the final."
Italy manager Roberto Mancini told RAI2: "It hasn't been a great draw, it could have gone better. We will have to beat North Macedonia and Portugal will have to beat Turkey.
"These are one-off games and there are always adversities. Just as we would have liked to have avoided Portugal, I think [Portugal] would have gladly avoided Italy. Will we get to the World Cup? We are always confident and positive; the most important thing will be to have all the players available."
Wales and Scotland were also drawn together, meaning only one of those two U.K. nations will be in Qatar. Wales face Austria and Scotland take on Ukraine in the semifinals. The remaining path sees Russia taking on Poland and Sweden playing Czech Republic.
"We've given ourselves a great opportunity," Wales manager Robert Page said in reaction to the draw. "We've worked ever so hard to finish second and get that home draw. We've got everything to play for."
Following the draw, Scotland boss Steve Clarke told the BBC: "Ukraine is up there with the toughest [draw] and then from that we know Wales have done really well recently. We know the Austrians well.
"We have shown over the course of the playoffs for Euro 2020 that we can handle the tension for semifinal and final games, and hopefully we can prove that again in March."
Twelve teams will take part in the playoffs, drawn into three paths of four teams with two semifinals and a final in each. The winners of the three finals will take the last European places at the World Cup.
The playoffs are one-legged matches, with seeded teams at home in the semis and the hosts of the finals determined by a draw.
World Cup 2022 takes place in Qatar from Nov. 21 to Dec. 18.
Scotland vs. Ukraine
Wales vs. Austria
The winners of Wales vs. Austria will be at home in the final
Russia vs. Poland
Sweden vs. Czech Republic
The winners of Russia vs. Poland will be at home in the final
Italy vs. North Macedonia
Portugal vs. Turkey
The winners of Portugal vs. Turkey will be at home in the final
The semifinals will be played on Thursday, March 24, with the finals on Tuesday, March 29.