The defender secured three priceless Champions League points with his 89th-minute heroics, a huge relief for boss Jurgen Klopp after last week’s 4-1 humbling by Napoli.
Mohamed Salah earlier ended a seven-game goal drought in the competition to nudge Liverpool ahead, but Ajax were level before the half-hour mark as Mohammed Kudus capped a 26-pass spell of possession.
Ajax went close through Daley Blind late on, but Matip was more precise as his header crossed the line despite Dusan Tadic’s desperate attempts to keep it out
E hosts edged ahead in the 18th minute as Alisson’s kick reached Luis Diaz, who found Diogo Jota. From a central position, Jota fed the eager Salah, who lashed past Remko Pasveer and into the bottom-right corner.
Both Van Dijk and Matip then headed over the crossbar from set-pieces as Liverpool kept up the pressure after the break, but Blind almost stunned Anfield from Tadic’s right-wing cross when he nodded a foot wide of the right post.
Liverpool substitute Darwin Nunez shot wide with seven minutes remaining, but Matip came good with time running out, rising to meet Tsimikas’ corner and power the ball towards goal.
While Tadic nodded away, the former Southampton man was a foot behind the line when doing so, and the relief inside Anfield was obvious as the goal was awarded.