Eden Hazard put Chelsea ahead with a fine finish five minutes into the game, but former Blue Oriol Romeu equalised for the Saints.
Just before halftime, Cahill put Chelsea back in front with a powerful header as Costa was lining up an acrobatic overhead kick.
When asked whether he was distracted by Costa, Cahill told Sky Sports: “He tried to claim it after I think as well!
“I saw Marcos [Alonso] was going to win that and he popped a nice ball back across.
“It’s one of them for a defender or any striker when the ball has been lofted over the like that – it’s dying to be attacked.
“It was great timing for the second goal. We went in at half-time with our tails up and it was a big boost for us and I’m sure it deflated them.”