Jurgen Klopp's men had the better of the opening 45 minutes but were unable to break the deadlock.
Cardiff, whose midweek victory away to relegation rivals Brighton had given them real hope of survival, looked determined to upset the odds and claim a valuable point as they created a few half chances early on.
However, Liverpool goalkeeper Alisson was rarely threatened and the visitors came out much the stronger in the second half -- and their pressure finally told as they opened the scoring on 57 minutes.
Trent Alexander-Arnold's low corner came to Wijnaldum, who rifled an effort into the corner.
Cardiff defender Sean Morrison should have pulled a goal back for the hosts when he somehow completely missed a header when presented with an open goal as the ball hit his back.
Morrison's day went from bad-to-worse as he conceded a penalty with 10 minutes remaining after tangling with Salah and Milner made no mistake from the spot.
"It was prepared to be a proper banana skin and we knew that, the boys were unbelievable," Klopp said. "It was clear, difficult for all of us.
"The boys try really with all they have, we only speak about the things we have to do. Their attitude is outstanding and it's a tough season but a very positive one as well."
Liverpool return to the Premier League's summit with Manchester City, who are two points behind travelling to rivals United on Wednesday to play their game in hand.
Cardiff remain in the drop zone, three points behind Brighton, who have a game in hand.