The Brazilian, who is set to leave after eight seasons with the Merseyside club, scored in the 89th minute to the delight of the crowd in Liverpool’s last home game of the season.
Juergen Klopp’s side are fifth with 66 points with one game remaining, but three points adrift of fourth-place Manchester United who have a game in hand. Unai Emery’s Villa are seventh with 58 points from 37 games.
Jacob Ramsey put Villa ahead in the 27th minute, after a period of sustained pressure, darting to the back post to head a cross from Douglas Luiz past goalkeeper Allison.
Villa could have taken the lead five minutes earlier when they were awarded a penalty, but Ollie Watkins sent his shot sailing wide.
Liverpool thought they had levelled early in the second half from a close-range goal by Cody Gakpo, but after a lengthy VAR check it was ruled out for offside.
Liverpool must win their final game at Southampton next week, and hope that Man United and Newcastle United lose their remaining two games to secure a Champions League berth.