But Salah restored the two-goal advantage after the break, and Diogo Jota then capped a memorable victory.
This means Everton now has eight league games without a win, and manager Rafa Benitez is under enormous pressure to turn the tide at the club.
Goodison’s first 45 minutes were breathless and Liverpool threatened to run away.
Joel Matip and Salah should have scored in the first two minutes, but the first goal came soon after.
Andrew Robertson got to the signing and cut the ball off, and Henderson ran over it to the edge of the box before producing a magnificent left-footed finish.
Before 20 minutes it was 2-0. Henderson played Salah on the right and he passed Lucas Digne to loop him past Jordan Pickford.
Some Everton fans have headed for existence at this point, but Gray gave the home side a lifeline with seven minutes to half time.
He controlled Richarlison’s pass well and his effort was enough under Alisson to cut the deficit in half.
Everton insisted on an equalizer in the second half and Andros Townsend had a dangerous free kick to the head.
From this corner, Liverpool once again increased their lead. Seamus Coleman hesitated as the ball hit him at the halfway line, Salah stole it and crossed cleanly. The Egyptian finished coldly ahead of Pickford, even though he lost his balance.
Jota stepped in, brilliantly passing Allan before crushing him at the near post to make it 4-1.
The remainder of the game went off without any actual incident, as Liverpool fans enjoyed the derby victory with chants of ‘Rafa behind the wheel’, with their ex-manager facing a real task to bring supporters back to Everton.