They surpassed the previous record of 263-5, set by Royal Challengers Bangalore in 2013
The Brazilian met a pass from fellow replacement Eduardo Camavinga and volleyed home in the dying minutes as Carlo Ancelotti’s side triumphed against their major rivals for top spot in Group D.
It was a painful conclusion to a game that Inter had dominated for large stretches but the hosts could not find a way past on-form goalkeeper Thibaut Courtois, who produced several crucial saves.
Real are second behind Moldovans Sheriff Tiraspol, who stunned Shakhtar Donetsk with a 2-0 win on their tournament debut and travel to Madrid next, while Shakhtar and Inter will look to get their first points on the board when they meet in Ukraine.