Bernado Silva opened the scoring for the English Premier League side at the Camping World Stadium after just nine minutes.
Marcos Leonardo levelled in the first minute of the second half and Malcom put the Saudi Pro League side in the lead with his goal on 52 minutes.
But City were back on level terms through Erling Haaland just three minutes later to take the game to extra-time.
Koulibaly scored with 94 minutes on the clock, and despite Phil Foden levelling up for City once again, the match was finally decided with a 112th minute scrambling Leonardo finish.
Speaking after the game, the Senegalese star said: "Scoring a goal against Manchester City in a tournament of this magnitude is amazing.
"We faced significant challenges, but we gave everything we had, and we feel overwhelming joy with this victory.
"We knew the match would be difficult against the best team in the world. We wanted to showcase our ideas, skills, and everything we prepared for this encounter.
"We provided strong defense and effective attack, and we capitalized on the available opportunities, and we are very proud of this achievement in a match of this level."
Al-Hilal will now face Fluminense in the quarter-finals on Friday 4 July 2025.