The 19-year-old midfielder scored from the spot eight minutes from time to seal United's first PL2 victory since October.
Liverpool looked on course for three points and going level with leaders Leicester City through Adam Lewis's 65th-minute free-kick.
Goalkeeper Danny Ward excelled in keeping United at bay, but was unable to prevent Joe Riley's equaliser on 79 minutes.
Three minutes later Gribbin completed the turnaround, converting after substitute Joshua Bohui had been fouled.
Liverpool remain second, three points behind Leicester on 33 points, with three matches remaining. A point below lie Arsenal, who have two matches in hand.
United remain bottom on 15 points but are now two points from safety, with four matches remaining.
Liverpool: 21 Mar v Boro (A) PL Cup
Man United: 18 Mar v Swansea (A) PL2