The Ghana striker made his appearance from the bench on 76 minutes as a replacement for Tommy Carroll with the Swans trailing 2-1.
The Blues consolidated their lead on top of the table with their victory as Cesc Fabregas sent them into the lead on 19 minutes.
However, Fernando Llorente put the visitors level just before the halftime call was made by the referee as the Swans went into the break with increased belief of a possible upset.
Their hopes were dashed by Pedro’s 72nd minute cracker that left Lukasz Fabianski flat on the floor. Ayew was sent in by manager Paul Clement to shore up his attack and try for another equalizer but Diego Costa would seal the win with six minutes left after receiving a pass from Eden Hazard.