Picked up by microphones during the game, Costa was denied a free-kick at one stage for diving.
"You threw yourself to the ground," said ref Jose Luis Gonzalez Gonzalez.
"F***!" replied Costa, before Koke pulled him away to avoid a booking.
However, the striker was to be shown a yellow card later in the game for protesting against a linesman, tapping his temple before stating: "You're crazy".
Costa managed to score, however, in the 2-0 win.