United took the lead through Juan Mata just after the halftime break, but was stunned by goals from Andre Ayew and Gomis to slip to a first league defeat of the season.
The Red Devils were hoping to move into second spot behind city rival Manchester City with a win and all looked well when Mata connected with a Luke Shaw cross to put the visitors ahead.
Swansea defender Ashley Williams was at fault as he hesitated for the goal but he was to redeem himself almost immediately.
He intercepted a sloppy pass from Wayne Rooney and charged forward before finding Gylfi Sigurdsson, whose cross was well met by Ayew to equalize.
Summer signing Ghana international Ayew then set up the winner with a delightful pass for Gomis to beat Sergio Romero with a low shot.
The United goalkeeper, replacing Real Madrid target David de Gea in the early season games, might have prevented the goal as Gomis scored for the fourth straight game from the start of the season.
United sought a late equalizer, but Rooney, who spurned a couple of first half openings, was again at fault as he looked set to score but delayed too long and Williams nipped in to make a saving tackle.
It was unheralded Swansea's third straight win over United, lifting the Welsh side to fourth in the early standings.
Rooney goal drought
Rooney, despite his midweek hat-trick as Manchester United progressed into the Champions League, is enduring a lean patch in club football and has not scored in 10 Premier League games, dating back to April.
United's lack of goals, just three in four EPL games, may increase the pressure on van Gaal to target a striker before the transfer window closes this week, with the 30-year-old Gomis one of a number of targets being mentioned.
But the Dutchman did not believe this was the problem in the Swansea defeat.
"We were 1-0 ahead and dominating the game," van Gaal told the club's TV channel.
"We could have scored many more goals -- I don't think that is the problem," he added.
United fans will also look with more than a passing interest at the signings of Manchester City, which completed a massive £55 million ($84.7m) deal to sign Belgium international midfielder Kevin de Bruyne from Bundesliga Wolfsburg Sunday.
It is the second biggest fee paid by an English club after United's £59.7m ($91.9m) signing of Angel Di Maria.
Former Chelsea star de Bruyne has impressed City manager Manuel Pellegrini, who has led his team to four straight wins at the start of the season.
"We like to play attacking, attractive football. Bringing in a player like this will only aid us.
"He has all of the mental, physical, tactical and technical attributes required to fit straight in," he told the club's official website.
Juve slumps again
In Serie A, defending champion Juventus suffered another chastening defeat, beaten 2-1 by AS Roma and having Patrice Evra sent off.
Having lost its opening fixture, the Old Lady was stunned by the capital side as Miralem Pjanic opened the scoring with a free kick in the second half,.
New Roma signing Edin Dzeko added a second goal late in the match before Paulo Dybala pulled one back for Juve, but it was too little too late, pointless after two Serie A games in its bid for a fifth title.