The Asian champions started the brighter of the two side's in the game in Yokohama, with Red Devils goalkeeper Edwin van der Sar twice tested by long-range efforts in the opening couple of minutes.
Six minutes in Cristiano Ronaldo forced Osaka keeper Yosuke Fujigaya into a low save with a left-foot drive from 25 yards.
Ten minutes later a fluent United move ended with Ronaldo having a shot from the edge of the area deflected behind, but no corner was awarded.
However, with 28 minutes on the clock United hit the front as Ryan Giggs swung in a corner from the right and Nemanja Vidic rose highest in the middle of the area to head home from eight yards out.
Anderson wasted a chance to double the lead when he failed to make proper contact with a fine Ronaldo ball in from the right flank, as United began to control proceedings.
They doubled their lead in first-half stoppage time as another Giggs flag-kick was headed home by Ronaldo.
Early in the second half goalscorer Vidic appeared to suffer a groin injury as he stretched to cut out a dangerous Yasuhito Endo ball into the area, but he recovered to continue.
Just past the hour van der Sar had to push away Endo's excellent free-kick from 25 yards, before Ryuji Bando fired the rebound narrowly wide of the far post.
Sixteen minutes from time Gamba Osaka pulled a goal back as the United defence opened up and Masato Yamazaki finished coolly from the edge of the area.
However, within a minute it was 3-1 to United as substitute Wayne Rooney made an instant impact by slotting home past the exposed Fujigaya.
With 78 minutes on the clock United opened up a three-goal cushion as the unmarked Darren Fletcher moved in to head home Patrice Evra's floated cross from the left.
Unbelievably it was 5-1 a minute later as Rooney strolled through to score his second goal, having only been on the pitch for five minutes.
The impressive Endo converted a late penalty, after Gary Neville had been penalised for handling a cross from the left flank, before Hideo Hashimoto rifled in a shot to make the final score 5-3.
Gamba Osaka: Fujigaya, Kaji, Nakazawa, Yamaguchi, Endo, Michihiro Yasuda, Myojin, Hashimoto, Bando (Terada 85), Lucas, Yamazaki.
Subs Not Used: Matsuyo, Shimohira, Futagawa, Kurata, Takei, Roneliton.
Booked: Yamaguchi.
Goals: Yamazaki 74, Endo 85 pen, Hashimoto 90.
Man Utd: Van der Sar, Neville, Ferdinand, Vidic (Evans 69), Evra, Nani, Anderson, Scholes (Fletcher 67), Ronaldo, Giggs, Tevez (Rooney 73).
Subs Not Used: Kuszczak, Rafael Da Silva, O'Shea, Carrick, Gibson, Park, Welbeck, Amos.
Booked: Rooney.
Goals: Vidic 28, Ronaldo 45, Rooney 75, Fletcher 78, Rooney 79.
Att: 67,618
Ref: Benito Archundia Tellez (Mexico).