The Norway international, who appeared 44 times for the Swiss side last season, scored 13 goals and registered 17 assists in all competitions.
Prior to his transfer to Basel, Elyounoussi scored 41 goals in 91 appearances for Molde.
"The club has been following me for a long time, watching many games, so I feel really confident to come here and to get even better and develop myself," the 23-year-old told the Saints' official website.
Manager Mark Hughes added: "He has got an outstanding record of goals and assists in two different countries, and we have been extremely impressed by the intelligence he has shown in his play from a tactical point of view.
"He's still at a young age as well, so we're confident he can continue to improve and fulfil even more of his potential with us, and, following on from the arrival of Stuart Armstrong this week, we feel we have made real progress in adding a new dimension to our attack ahead of the season."
Southampton begin their Premier League campaign with a home match against Burnley.