- James Ward-Prowse (19')
- Kamaldeen Sulemana (28', 48')
- Adam Armstrong (64')
- Diogo Jota (10', 73')
- Roberto Firmino (14')
- Cody Gakpo (72')
The Brazilian struck to put Liverpool 2-0 ahead in the 14th minute after Diogo Jota fired in the visitors' opener.
Sulemana scored again early in the second half after a storming run and finish and Adam Armstrong capitalised on a loose pass by Jordan Henderson to make it 4-2 as Southampton looked to at least sign off their 11-year stay in the top flight with some belated cheer for their fans.
But Liverpool, who will have to settle for Europa League football next season after finishing a disappointing campaign in fifth, roused themselves and scored twice in a minute.
Liverpool extended their unbeaten league run to 11 games and Salah almost won it for his side with a sublime lob but his effort struck the woodwork.
"Crazy game, a bit too crazy for my tastes to be honest. The start was really good, the finish was outstanding, in the middle it was not good enough, it's as easy as that," Liverpool manager Juergen Klopp said.
"Four-four, eight goals, for the people it was really entertaining. I enjoyed it not so much."
Firmino, who joined Liverpool in 2015 and was a key figure in a golden era for the club, winning a Champions League winners' medal, FA Cup and a Premier League title, also scored on his final Anfield appearance.
And the 31-year-old was at it again as he sold a dummy to two Southampton defenders before slotting past goalkeeper Alex McCarthy for his 111th goal for the club.
At that stage it appeared Ruben Selles' last game in charge of Southampton would be a drubbing, but his side responded with a display that has been sadly missing this season.
- Darren England
|Brighton & Hove Albion||6||5||0||1||+10||15|
|West Ham United||6||3||1||2||+1||10|