Saints came close to opening the scoring in the first minute after Shane Long was put through on goal, but the forward blasted his effort well over the bar.
Long, who had not scored since February, redeemed himself by opening the scoring and ending his drought one minute later, sweeping Jeremy Pied's cross into the top corner of the net.
The game was then turned on its head in the 80th minute as Bakary Sako kept the ball alive down the right and worked it to Townsend, who cut back for Luka Milivojevic to find the bottom corner of the net with a shot on the edge of the box.
Southampton came close to striking an equaliser on 86 minutes when Ryan Bertrand's delivery was helped on by Oriol Romeu and Manolo Gabbiadini was just inches from connecting, the Italian's claims that McArthur was holding him back waved away by referee Stuart Atwell.
Palace then nearly found a third a minute later, only for Wilfried Zaha to spurn a gilt-edged opportunity by firing over the bar from Hennessey's long ball, but in the end it did not matter as Roy Hodgson's charges held on to all three points.
Southampton (4-2-3-1): McCarthy; Pied, Stephens, Yoshida, Bertrand; Romeu, Hojbjerg (Gabbiadini 75'); Ward-Prowse (Davis 70'), Tadic (Redmond 80'), Boufal; Long
Crystal Palace (4-2-3-1): Hennessey; Fosu-Mensah, Kelly, Tomkins, Schlupp (Sako 64'); McArthur, Milivojevic; Townsend, Cabaye (Van Aanholt 46'), Zaha; Benteke