Mohammed Salah has now scored 34 goals for Liverpool in the Champions League
Boss Jurgen Klopp demanded a reaction to the "horror show" of the 4-1 defeat at Napoli in their group opener and this was certainly a vast improvement.
Liverpool created plenty of openings and deservedly went ahead when Mohamed Salah swept home Diogo Jota's pass.
Mohammed Kudus' searing shot went in off the underside of the bar to level but Matip pounced in the 89th minute.
Daley Blind missed a great chance to put Ajax ahead late on before Matip - whose previous Champions League goal was nine years ago - rose to head the winner, which was confirmed by goal-line technology.
Liverpool needed to respond to the debacle of Napoli and while they were nowhere near their best this was all about getting the victory that would make Champions League Group A look more positive for Klopp's side.
It looked for a long time that Ajax's composed manner allied to Liverpool's lack of cutting edge might mean they would have one point from two games as they prepare to play Rangers home and away.
Instead, Matip's winner ensured an important three points for last season's beaten finalists and Klopp will hope it is the start of their recovery from the defeat in Italy he labelled the worst performance of his reign at Anfield.
Before the game, there was a short period of silence in tribute to Queen Elizabeth II and while there were a handful of dissenting voices, they were hushed by the vast majority of those inside Anfield, who observed the tribute respectfully.
Once the action started, match-winner Matip and Thiago Alcantara were the keys to Liverpool's improvement from last week at Napoli, the defender not only being strong at the back but bringing the ball out of defence in his typical adventurous manner.
The former Schalke defender's decisive late contribution capped an outstanding display and he made Klopp's defence look far more solid than in Italy last week.
Thiago's ability to dictate the tempo has been sorely missed while he has been injured and his performance was a signpost to how important he will be as Liverpool try to recover from an indifferent start to their season.
Ajax are surpassed by very few clubs in world football in terms of unearthing talent and the latest gem looks to be Ghana forward Kudus.
The 22-year-old forward was strongly linked with a move to Everton at the end of the transfer window but Ajax blocked the deal given they were about to lose Antony to Manchester United.
Ajax believe Kudus will make a key contribution to their season - and presumably that his value will therefore significantly increase.
They have been proved correct so far. He was outstanding in the 4-0 thrashing of Rangers in Ajax's opening group game and his fierce finish at Anfield was a sign of the quality the powerful, skilful forward possesses.
He thumped in an emphatic equaliser off the underside of the bar after he was played in by Steven Berghuis and Steven Bergwijn.
Ajax will naturally be disappointed with the final outcome given they were minutes away from a valuable point, but they will justifiably feel they showed enough to believe they can progress from what is shaping up as a tight group.
-- Courtesy of BBC Sport