Mohamed Salah, who scored twice, grabbed the 69th-minute winner for Liverpool after Salzburg, managed by American Jesse Marsch, had stunned Anfield with three goals either side of halftime to make it 3-3.
Liverpool would be relieved to have avoided their first home defeat in the Premier League or Champions League since April 2017.
However, there were concerns about the performance of their defence, which was exposed by the lively Salzburg attack.
Salzburg, who beat Belgium’s Genk 6-2 in their opening game in the group, were applauded off the field by their traveling fans, recognition for their spirit and the enterprising, positive football they played against Juergen Klopp’s side.
Liverpool, beaten 2-0 by Napoli in their opening game, quickly took charge, taking the lead in the ninth minute with a beautifully-worked goal from Sadio Mane.
The Senegalese left two defenders in his wake as he cut in from the left and then drove home after a crisp exchange with Roberto Firmino.
Left back Andy Robertson made it 2-0 in the 25th minute, starting the move with a burst down the flank and then staying forward to apply a deft finish to Trent Alexander-Arnold’s low cross.
Salah then made it 3-0, turning the ball in after Salzburg keeper Cican Stankovic had pushed away an angled header from Firmino.
The Austrians pulled a goal back in impressive fashion, with South Korean Hwang Hee-chan leaving Virgil van Dijk on his rear with a sharp turn inside, before he blasted past Adrian in the 39th minute.
Hee-chan then turned provider when his cross from the left was met with a superb volley from Japanese striker Takumi Minamino, who buried the ball in the bottom corner from 20 metres out in the 56th minute.
The home crowd could barely believe it four minutes later when the impressive Minamino slipped the ball across the face of the goal and 19-year-old substitute Erling Haaland tapped in.
Haaland had scored a hat-trick in the win over Genk and the tall striker had the extra satisfaction of matching his father, Alf-Inge, who scored for Leeds United at Anfield in a Premier League match 22 years ago.
Klopp threw on a fourth forward in Divock Origi as he looked to retrieve the game and Salah secured the points for Liverpool in the 69th minute.
The Egyptian firing home his second goal after a header down from the always-influential Firmino.
“Salzburg are a really good team and after we went 3-0 up it was a tough game to try and push – but we deserved the win,” said Liverpool’s former Salzburg striker Mane.
“To be honest, I knew how good Salzburg were as I was there for two and a half years.
“They never give up and push and they caused us problems, but in the end, we scored more goals.”
The win left Liverpool second in the group on three points, one behind leaders Napoli who were held to a 0-0 draw at Genk earlier on Wednesday.