Joseph Opoku, Ben Cabango and Zan Vipotnik were on target as the Swans moved up to seventh and five points off the top.
Former captain Ashley Williams led Swansea for the third and probably final time, with Rosenborg boss Freyr Alexandersson expected to be in charge for Saturday’s trip to Bristol City.

Cardiff's wait for a win on the road this season continues as the Bluebirds drop to 19th, four points above the relegation zone.
Joseph Opoku opened the scoring just 15 minutes in when he was left unmarked to stroke home his fifth goal of the season, and second in successive games, to become Swansea's top scorer.
Cabango doubled the home side's lead when Filip Lissah flicked on Josh Tymon's corner and the Wales centre-back lashed home into the roof of the net just before the hour mark.

Substitute Vipotnik added a third 21 minutes from time to give Williams a perfect send off.
