Seven-time winners Milan were playing their first Champions League match for seven years and were given a rude awakening to the step up in class but for a two-minute spell before half-time that threatened to take the game away from Liverpool.
Fikayo Tomori's early own goal was scant reward for the home side's early dominance as Mike Maignan saved Mohamed Salah's penalty.
But goals from Ante Rebic and Brahim Diaz turned the game on its head completely against the run of play.
Salah levelled the scores once more before Henderson's thunderous finish proved a deserving winner 21 minutes from time.
"It was a brilliant game," said Liverpool boss Jurgen Klopp. "Very exciting, very entertaining with 10-15 minutes where we lost the plot."
A 0-0 draw between Atletico Madrid and Porto means Liverpool end the night on top of Group B and Klopp underlined the importance of a winning start in such a tough section.
"Milan came from pot four in this group, that's the quality in this group," added the German. "We need each point in this group to get through."
Liverpool's pressure paid in a blistering start when Trent Alexander-Arnold burst into the box from right-back and his shot was turned into his own net by Tomori.
But Salah could not keep his long scoring streak from the penalty spot going on 14 minutes after Andy Robertson's shot was handled inside the area by Ismael Bennacer.
The Egyptian had scored 17 consecutive penalties for Liverpool dating back to 2017, but Mike Maignan parried his powerful effort and Henderson's follow-up on the rebound.
The visitors appeared to be missing the presence offered by the injured Zlatan Ibrahimovic up front.
However, Anfield was stunned as the Milan attack suddenly clicked just before the break.
Rebic slotted home Rafael Leao's through ball to level.
The Croatian then turned provider two minutes later for Alexis Saelemaekers and when his effort was blocked on the line by Robertson, Diaz followed in to tap into an unguarded net.
"We let them back into the game and walk in at half-time thinking 'how have we let this happen?'" Robertson said.
"When you play in this tournament it is against good teams. We need to be smarter. It's really tough but we managed to come out second half, play our football and enjoy it again."
Liverpool's three goals in Istanbul 16 years ago came in six minutes and Milan nearly exacted revenge with the same feat either side of the break only for Simon Kjaer's strike to be ruled out for offside.
A pulsating game had another momentum swing moments later when Divock Origi's lofted pass played in Salah to prod home from close range.
Roared on by the first Anfield crowd for a European night since March 2019, Liverpool found their second wind and a winner.
A corner was only partially cleared to Henderson on the edge of the box and the England midfielder smashed the ball first time low past Maignan.
"We are not quite there yet," said Pioli. "Liverpool are on a very high level, but we will use this game to make sure we can develop even further and gain experience in this competition."