A heavily changed Real Madrid side made a slow start at Estadio Riazor with Jose Callejon coming closest to scoring in the first half when he headed Kaka’s cross wide at the far post.
Deportivo took the lead on 35 minutes when Riki’s stunning shot from a wide area found the top corner, although questions will be raised over Diego Lopez’s positioning as the shot beat him at his near post.
Madrid showed signs of improvement after going behind but Deportivo almost scored again before half-time when Bruno Gama’s low strike was turned away by Lopez.
Carlos Marchena could have doubled Deportivo’s lead when he scuffed wide from a glorious position but the game swung in Real Madrid’s favour when Cristiano Ronaldo and Sami Khedira were introduced as substitutes on the hour mark.
Kaka levelled the tie with a wonderful curling shot on 73 minutes and Higuain stole the three points in the dying moments when he steered in Ronaldo’s cross from close range.
The result moves Real Madrid within a point of second-placed Atletico Madrid in La Liga while Deportivo remain bottom, eight points from safety.
Karlan Aherne-Grant's second-half brace earned Crawley a share of the spoils after coming from 2-0 down at Carlisle.
Coventry consolidated their position in the play-off places as first-half goals from Jonson Clarke-Harris and Tom Bayliss earned a 2-1 win at lowly Crewe.
Wolves took another step closer to promotion and the Sky Bet Championship title with a convincing 3-1 win against relegation-threatened Burton at Molineux.
Milan Djuric's header put Bristol City's play-off bid back on track as it secured a 1-0 Championship victory over Ipswich at Ashton Gate.
Rob Dickie's first goal for his new club helped managerless Oxford United to a 2-1 victory over 10-man Peterborough for their first win in six matches.
Alex Fisher's first-half strike secured Yeovil Town their first victory in five league matches with a 1-0 win at Colchester United.
Port Vale fought their way back from a two-goal deficit to claim a share of the spoils in a 2-2 draw against Stevenage.
Brentford held on for a point with 10 men in an enthralling 1-1 draw with play-off chasers Middlesbrough at Griffin Park.
AFC Wimbledon frustrated fellow relegation battlers Rochdale as they survived an onslaught to hold on for a point after a 1-1 draw at Spotland.