The bottom-of-the-table Blades were on course for a shock draw at Anfield, but Mac Allister – a World Cup winner with Argentina – scored with a brilliant 20-yard strike into the top corner to put the Reds 2-1 up.
Cody Gakpo added a 90th-minute third as Liverpool returned to the top of the table.
Boss Klopp said: “We needed Macca’s wonder goal to turn it around. He is super important for us, a wonderful player and a wonderful boy – I’m really happy for Liverpool that we got him.
“His defensive work has been really good where people were doubting if he could be defensive, but I prefer him in the eight [attacking midfield].
“He is a really good player. In the first half he was playing [as a] six, but we knew we could move him slightly higher. Then he scores this kind of goal, the two biggest screamers of the season [after also scoring from long distance against Fulham] have come from him. Then the free-kick directly after [the goal] – absolutely insane, what a player.”
Mac Allister, who joined Liverpool for £35m from Brighton last summer, also hit the crossbar with a curling free-kick.
Liverpool were gifted a 17th-minute lead when Darwin Nunez charged down goalkeeper Ivo Grbic’s clearance with the ball rebounding into the net.
Despite having 84% of possession in the first half and wasting numerous chances, the hosts conceded a 58th-minute equaliser as Gustavo Hamer’s header bounced off Conor Bradley and into his own net.
But Mac Allister – nominated for March’s Premier League Player of the Month award – put the hosts back in front with 14 minutes left, before substitute Gakpo’s header sealed a vital success.
The result moved the Reds two points clear of Arsenal and three ahead of reigning champions Manchester City, with eight league games left.
More importantly, it also kept Liverpool’s title destiny in their own hands.
They know if they beat Manchester United, Crystal Palace, Fulham, Everton, West Ham, Tottenham, Aston Villa and Wolves, it will secure their second Premier League title and confirm them as top-flight English champions for a 20th time.