In a hectic spell midway through the first half, Oscar put the hosts ahead in the 23rd minute, Andre Ayew leveled in the 29th and Chelsea's lead was restored after an own goal by Swansea defender Federico Fernandez.
Everything changed within 10 minutes of the restart, when Courtois was dismissed for felling Bafetimbi Gomis as the France striker burst into the area on the break.
Reserve keeper Asmir Begovic came on for Oscar but could not prevent Gomis slotting home the spotkick.
Gomis later had a goal disallowed for offside as Swansea pressed for a winner.
Costa's acrobatics earn Chelsea 2-2 draw at Swansea