Hosts Cordoba were set to breathe new life into their hopes of survival in the Spanish top flight, as they led 1-0 in the dying stages at the Estadio Nuevo Arcangel.
Florin Andone had put Cordoba ahead in the 77th minute, but their bid for a fourth win of the season faltered late on.
A Fede Vico own goal handed Getafe an equaliser in the 87th minute, before Juan Rodriguez headed a stoppage-time winner to leave Cordoba four points adrift in bottom place - and seven points shy of safety with 26 games played.
Vico's own goal was notably calamitous, beating goalkeeper Mikel Saizar with a backheel flick that would have had spectators purring at the other end.
Getafe's fortune saw them earn their eighth win of the season, taking them five points clear of the bottom three.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.