Ronaldo scored twice in his first game since signing for Saudi Pro League side Al Nassr following his departure from Manchester United.
Messi, back with PSG after winning the World Cup with Argentina, got the first goal of the game before Ronaldo equalised for the Saudi select team -- made up of players from Al Nassr and Riyadh rivals Al Hilal -- with a well-struck penalty.
During a frantic end to the first half, PSG defender Juan Bernat was sent off, Marquinhos put the French champions 2-1 up, Neymar missed a penalty and Ronaldo scored his second of the evening after his header had rebounded off the post.
Both Ronaldo and Messi were substituted after 60 minutes but they were still on the pitch long enough to see Ramos put PSG 3-2 up, Saudi select defender Jang Hyun-Soo equalise and Kylian Mbappe score a penalty to make it 4-3.
Substitute Hugo Ekitike scored again for PSG and Anderson Talisca got a late consolation as the game finished 5-4.
With Ronaldo having left European club football for Saudi, it's possibly the last time he will share a pitch with longtime rival Messi.
After PSG's trip to the Middle East, they are back in action against Pays de Cassel in the French Cup on Monday.
Ronaldo, meanwhile, is set to feature for Al Nassr for the first time on Sunday after his debut was delayed due to a two-match suspension handed down by the English FA for an incident during his spell at Old Trafford.
Decked in a new black and gold kit, PSG made a blistering start to the game, racing into the lead in the third minute thanks to a deft finish from Messi.
Played through on goal by Neymar, Messi was able to poke the ball past goalkeeper Mohamed Al-Owais, who he last faced in Saudi Arabia's shock World Cup win over Argentina in November.
Despite going behind early, the Riyadh Season Team had numerous chances.
Ronaldo was an ever-present threat and won a penalty when goalkeeper Keylor Navas clattered into him. Sporting a bright red bruise on his cheek as a result of the collision, Ronaldo picked himself up to calmly convert the spot kick and level the game.
Bernat was shown a red card right after the equaliser, but the Ligue 1 club responded well to going a man down, scoring through defender Marquinhos.
Their lead would not last long, as Ronaldo once again levelled the game on the verge of half-time, hammering home a rebound after Sergio Ramos botched a straightforward clearance.
The goals continued to come thick and fast after the break, as Ramos turned in a Mbappe cross before Jang replied with a near-post header from a corner to make it 3-3.
A handball by Ali Al-Bulaihi gave the visitors a penalty, which was expertly dispatched by Mbappe on the hour. It was Mbappe's last contribution, as he was taken off shortly after, along with teammates Messi and Neymar, as well as Ronaldo.
Ekitike then extended PSG's lead to 5-3 with a thumping finish following a lung-busting run from the halfway line before Anderson Talisca's goal for the Saudis in added time.
Information from Reuters was used in this report.