It was a harsh result for Inter against Carlo Ancelotti's Madrid, who up to that point had shown little of the attacking verve which has brought them 13 goals in four La Liga games so far this season.
Inter dominated the early exchanges and should have been at least one goal ahead midway through the first after getting at a Madrid defence which had conceded six goals in their opening four La Liga matches.
First, Lautaro Martinez managed to work space for a close-range shot in the sixth minute which was directed straight at Courtois, and three minutes later Edin Dzeko drew the best out of the Belgian.
The Bosnia forward managed to break the offside trap following a slick passing move but couldn't direct his shot past the onrushing Courtois, and Milan Skriniar headed a presentable chance wide at the following corner.
In the 19th minute Martinez wasted Inter's biggest opportunity of the half, heading straight at Courtois after finding himself completely unmarked by the penalty spot when Ivan Perisic's pinpoint cross arrived.
And they were lucky to not be punished by Eder Militao 20 minutes later when the Brazilian somehow headed wide from a corner from point-blank range.
Marcel Brozovic then fired just wide from the edge of the penalty area before Dzeko became the latest Inter player who couldn't find a way past Courtois when he hit another great chance straight at the 29-year-old.
Madrid came out on the front foot after the break but it was again Inter who had the first real chance through Dzeko, whose header was batted away, and then Skriniar, who couldn't quite force home the opener on the rebound.
The away side then came back into the game and forced a save from Samir Handanovic just before the hour mark through Dani Carvajal.
They pushed Inter back but struggled to get past their well-organised back three until Rodrygo silenced the rowdy Inter crowd with his late winner.