At 2-0 up and with just under 20 minutes left, United looked to be coasting to an easy win after first-half headed goals, both directly from corner kicks, for Nemanja Vidic and Cristiano Ronaldo. But on 73 minutes, Gamba striker Masato Yamazaki pulled a goal back with a nice strike to bring both the crowd and the game back to life.
It brought United back to life too, as the European champion promptly scored three goals in four minutes to make the game safe at 5-1. Wayne Rooney, who had been substituted into the game just seconds before Gamba scored, hit a well-taken brace, with a Darren Fletcher header sandwiched between. Gamba gave the scoreline a more respectable look thanks to a cool penalty kick from Yasuhito Endo, and a stinging stoppage time effort from Hideo Hashimoto.
"The fans got their money's worth," said United manager Alex Ferguson. "Gamba really played well, I was impressed. It was a great match and the score could have been even higher by the final whistle. Edwin van der Sar made three tremendous saves to secure the win for us."
Gamba's Akira Nishino said that "it was obviously an entertaining match for the spectators, but I can't be happy with the result because we lost. Wayne Rooney was the one we really didn't get to grips with. We gave them two easy goals from corners and that killed us. We weren't given a prayer to win this game, but we scored three goals so we have to be proud."
Adelaide United beat Al-Ahly of Egypt, 1-0, on a goal from Cristiano to take fifth place.
Schedule (live on Fox Soccer Channel)
Third-place game: Pachuca vs Gamba Osaka (Sunday, 2.30 a.m. ET)
Final: Manchester United vs LDU Quito (Sunday, 5.30 a.m. ET)