Ronaldo scored twice at the King Fahd International Stadium.
It was his first game since joining Saudi Pro League side Al Nassr from Manchester United.
Messi got the first goal before Ronaldo equalised from the penalty spot.
Marquinhos put PSG 2-1 up, but Ronaldo levelled again, firing in his rebound.
Both Ronaldo and Messi were taken off after 60 minutes.
Sergio Ramos put PSG 3-2 up, before Jang Hyun-Soo equalised and Kylian Mbappe scored a penalty to make it 4-3.
Hugo Ekitike came off the bench to net for the Ligue 1 champions and Anderson Talisca grabbed a late consolation as the match finished 5-4.