Sarabia blasted home a late winner to end Getafe’s barren league spell, after midfielder Castro had struck the bar with a penalty.
Celta’s own rut continued unchecked into a 10th league game without victory, however, as the hosts ground their way to the points.
Alvaro Vazquez’s finish for Getafe had cancelled out Charles’ early Celta goal in a clash that had been heading for a draw.
But after Castro spurned a spot kick with 12 minutes to play, up popped Sarabia to hand Getafe a late reprieve, firing home five minutes from time.
When two sides boasting just seven goals in their combined last 18 league matches, crisp finishing is sure to be in short supply, and so it proved in Madrid.
With both teams in freefall and misfiring since October, any winner would be able to claim a foothold in the table, and the hosts obliged in the closing stages.
Getafe coach Quique Sanchez Flores had told his side to treat the second half of the season as a mini league for the teams in the bottom half of the table.
The new manager had been unable to solve the problems that dogged former boss Cosmin Contra’s tenure, however, but this victory will boost confidence.
Celta powered ahead on the quarter-hour, Brazilian forward Charles firing a right-foot shot home after fielding Nolito’s pass.
The home side rallied immediately, with Pablo Sarabia sending Vazquez clear and the former Swansea forward doing the rest.
Spain Under-23 cap Vazquez had two reasonable chances in the second half, but was unable to make either count.
Getafe’s frustrations peaked when midfielder Castro hit the bar from the penalty spot with just 12 minutes to play.
But just as the tie looked to be petering out for a draw, Sarabia latched onto Croatia midfielder Sammir’s free-kick to steal the spoils.