Ryan Kent gave Steven Gerrard's side the lead just before half-time but Steven Boyd scored a spectacular equaliser with 10 minutes left.
James Tavernier then converted two penalties in the closing minutes and Alfredo Morelos grabbed the fourth goal in stoppage time.