The match couldn't have started much better for the visiting Saints, who went 1-0 ahead within the opening minute.
However, just one minute before the break the home side were level courtesy of Nicky Bailey, who struck into the net from outside the area.
Both sides continued to threaten to score the third goal of the match after the restart, although neither goalkeeper was called into any telling action during the opening moments.
The winning goal eventually arrived 14 minutes from time when Merouane Zemmama struck from distance past Kelvin Davies in goal.
Southampton will still gain promotion if West Ham United fail to beat Leicester City on Monday night.