Costa struck in the 67th minute after his teammate Gary Cahill cancelled out Emre Can's opener before the break.
The result saw the table-topping Blues move to 29 points from 11 games - seven points clear of closest rival Southampton, and 15 ahead of the seventh-placed Reds.
The hosts started brightly, as Can's 30-yard strike found the back of the net via a deflection off Cahill.
However, Jose Mourinho's unbeaten side equalised six minutes later, as Cahill pounced on the rebound after Simon Mignolet kept out John Terry's header off a corner, with the referee making use of goalline technology.
Liverpool looked to go ahead in the 19th minute, but under-fire striker Mario Balotelli's effort was ruled out for offside.
Costa threatened just before the interval as he saw his powerful shot from the edge of the area thwarted by Mignolet.
The Merseysiders came out strongly after the recess, as Raheem Sterling had an effort on goal superbly saved by Thibaut Courtois.
Costa, though, delivered the decisive blow with an emphatic finish from 16 yards out after Cesar Azpilicueta's cross triggered a goalmouth scramble.