The substitute received the ball midway inside his own half on 85 minutes and weaved past four opponents to the area before curling past Ben Foster.
Southampton had the best chances of the first half, with Ryan Bertrand’s free-kick hitting the woodwork.
Despite Jonny Evans going off injured, West Brom threatened after the break, Jay Rodriguez shooting wide when through on goal.
Southampton’s Dusan Tadic also was put through on goal, but Foster denied him.
With a draw looming, Boufal produced his magic to give Southampton a first win in four and lift them to 10th, above West Brom, who have not won in seven.