The France international found the net for the first time since joining on a free transfer last month after his contract with Lyon expired.
Gomis headed home the opener from close range in the 31st minute before midfielder Josh Sheehan ensured the victory over the League Two side 12 minutes from time.
New signing Jefferson Montero was included from the start, and the Ecuador winger proved a lively threat in a first half of few chances.
Montero fired wide after 24 minutes as Swansea began to get on top, but his profligacy mattered not as Gomis put the visitors ahead at St James' Park.
The 28-year-old met Neil Taylor's cross with a fine header from 10 yards, giving Swansea fans a glimpse of his quality ahead of the new season.
Two minutes before the interval Gomis came close to doubling his tally, hitting the post after being teed up by the impressive Montero.
Wilfried Bony, Wayne Routledge and Jonjo Shelvey all came on for Swansea for the second half as manager Garry Monk shuffled his pack.
The number of changes did disrupt the flow of the game, but Swansea were still able to dictate play, defender Kyle Bartley heading narrowly wide from Shelvey's corner.
But nine minutes later Swansea wrapped things up as Sheehan slotted home from a throughball from Bony, who then saw a header cleared off the line in the closing stages.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.