United goalkeeper David de Gea limped off at half-time after suffering a knee injury when attempting to save Southampton's second goal.
United became the first side in Premier League history to come from behind to win four successive away games and they had Cavani to thank for the dramatic turnaround on the south coast.
Ole Gunnar Solskjaer's men moved into the top half of the table with the win, up to seventh on 16 points, one point behind Southampton, who saw their seven-match unbeaten league run brought to an end.
United started brightly and almost took the lead inside the opening minutes but Mason Greenwood missed the target after rounding the goalkeeper.
Fernandes came close moments later when his long-range effort hit the post and narrowly went wide.
However, it was Southampton who broke the deadlock when Bednarek headed home from Ward-Prowse's corner.
The hosts doubled their lead after 33 minutes when Ward-Prowse scored a fantastic free kick which saw De Gea's knee strike the post in his attempt to save it.
Cavani replaced Greenwood in the second half and set up Fernandes to score on the hour mark to get United back in the game.
Fernandes returned the favour 14 minutes when his shot was turned into the back of the net by a Cavani header.
United dominated the latter stages, and the 33-year-old Cavani struck again in stoppage time, his near-post header from Marcus Rashford's cross earning all three points.
"Great impact of course," United manager Ole Gunnar Solskjaer said of Cavani. "He is always on the move, he wants to get in front of you and I am very pleased with him.
"His hunger to get on the end of things is the key for a centre-forward. Sometimes it hurts and sometimes it doesn't but to score you have to be in there."
Information from Reuters was used in this report.