On a night where Arsenal and Tottenham dropped points, Chelsea, who remain nine points clear, took a first-half lead courtesy of a wonderfully executed 30-yard free-kick from David Luiz that caught Simon Mignolet unawares.
Georginio Wijnaldum headed an equaliser for Jurgen Klopp’s team but they had to be thankful to Mignolet with 15 minutes remaining as he saved Costa’s spot-kick after the Chelsea striker had been fouled by Joel Matip.
The result snapped a run of three straight defeats for Liverpool but they still remain winless in the Premier League in 2017.
Chelsea take on third-place Arsenal, live on Sky Sports, on Saturday lunchtime.
Liverpool were boosted pre-match with the return of Sadio Mane to their ranks, although he was only fit enough for a place on the bench. Chelsea kept to their tried and tested formula that had won 15 of their last 16 Premier League games, making just one change as Pedro was given a rest with Willian coming in.
Klopp’s men tried to get in Chelsea’s faces in the early stages, but the visitors were in wily mood as they sat deep and took the sting out of Liverpool’s high press.
Wijnaldum stung the palms of Thibaut Courtois on 12 minutes but that was Liverpool’s only shot on target of the first-half.
Chelsea looked a threat when Eden Hazard and Costa got the ball in Liverpool’s final third, and it was the former being tripped by Adam Lallana in the 24th minute, which paved the way for Luiz to open the scoring.
Willian lined the set-piece up but Luiz took the initiative while Mignolet was still getting himself set and fired an arrow-like effort into the net via the post. Liverpool complained to referee Mark Clattenburg but he had clearly whistled four seconds before Luiz struck the ball. It was the Brazilian’s first goal since returning from Paris Saint-Germain last summer.
Moments later, a free-kick from a similar position by Willian had to be palmed away by Mignolet as the ball skidded off the sodden Anfield turf.
Liverpool managed to open up Chelsea for the first time after 49 minutes but Roberto Fimino miscued an effort from 12 yards into the stands when well found by Nathaniel Clyne.
But the Anfield faithful were celebrating an equaliser eight minutes later. Jordan Henderson chipped a magnificent ball to the back post, where James Milner was waiting. The full-back kept his cool and headed back across goal and Wijnaldum climbed highest to bundle head home.
The equaliser changed the atmosphere inside the stadium but Chelsea rode the storm and hit Liverpool on the break with 15 minutes left.
Cotsa, who had run Matip ragged all night, turned the defender inside the area and after a collision of knees, the Blues top scorer hit the deck. Clattenburg pointed straight to the spot.
With Arsenal losing at Watford and Spurs drawing at Sunderland, this was a penalty that could take Chelsea 11 points clear at the top.
Costa stepped up but – despite striking it with power – Mignolet guessed correctly and clawed the ball behind for a corner.
Both teams had chances to win it in injury time as Firmino headed straight at Courtois and Pedro curled an effort inches wide from the edge of the box.