Costa was named in the Atletico XI for the first time since sealing an emotional return to the capital club, and he netted his team's second in their 2-0 win.
The former Chelsea forward was then incredibly sent off moments later as he picked up a second yellow card for celebrating with the crowd behind the goal.
The victory has seen second-placed Atletico move to within six points of league leaders Barcelona, while Getafe remain in eighth position in the table.
On-loan Arsenal stopper Emiliano Martinez made his La Liga debut for Getafe in place of Vicente Guaita. Meanwhile, Mauro Arambarri was back from suspension to start for the away side, who had Angel Rodriguez, Jorge Molina and Amath Diedhiou in the final third.
Getafe had the first opportunity of the match in the fourth minute, but Angel could only chip into the arms of Atletico goalkeeper Jan Oblak after breaking into a shooting position.
Costa then came close down the other end - curling one just over the Getafe crossbar from distance as both teams threatened in the early exchanges.
Amath volleyed a Molina cross into the arms of Oblak in the 10th minute as Getafe again came close, before Antoine Griezmann fired wide down the other end after combining with Costa in a dangerous area.
The first goal was coming, and it was Atletico that made the breakthrough in the 18th minute when Angel Correa expertly found the bottom corner with the outside of his boot following a cute pass from Griezmann.
Getafe did not divert from their gameplan, however, and another opportunity arrived for Amath in the 21st minute. The striker was fed once again inside the Atletico box, although his strike was right at Oblak.
Chances were few and far between in the latter stages of the first period, however, with a series of late challenges - and indeed bookings - harming the tempo, and there was a real sense of ill-feeling at the half-time break.
Costa had to be ushered down the tunnel at the interval as tempers threatened to boil over as the match descended into chaos following a bright start.
It took until the 58th minute for either side to have a clear chance in the second period; it fell for Costa after the Atletico forward won the ball inside the Getafe box, but he fired over the crossbar.
Costa was not to be denied in the 68th minute, however, as he converted a low cross from Sime Vrsaljko to cap off his return to the team with a goal.
The Spain international was shown a second yellow card for going into the crowd while celebrating though as his La Liga return ended in spectacular fashion.
Getafe had chances to hit back late on in a bid to make it an uncomfortable conclusion for Diego Simeone's side, but Atletico kept yet another clean sheet to record all three points in routine fashion.
ATLETICO (4-3-3): Oblak; Vrsaljko, Savic, Godin, Lucas; Correa (Gimenez 84'), Koke (Torres 88'), Gabi, Carrasco (Thomas 60'); Griezmann, Costa
GETAFE (4-4-2): Martinez; Suarez, Djene, Cala, Antunes; Portillo (Jimenez 64'), Mora (Shibasaki 64'), Arambarri, Amath; Molina, Angel (Pacheco 74') body check tags ::