The £56million summer signing from AC Milan had missed the last six weeks with a groin problem but he was back with a bang on Saturday night, netting the decider against 10-man Real Zaragoza soon after appearing as a 75th-minute substitute.
Earlier, Madrid had taken a 50th-minute lead through Raul but relegation-battling Zaragoza, despite having Matteo Contini sent off two minutes later, still managed to draw level Adrian Colunga on the hour-mark.
That equaliser could have cost Madrid dear with leaders Barcelona having beaten Xerez 3-1 earlier in the evening, but Kaka's late strike keeps Manuel Pellegrini's men one point behind the Catalan club with four games now remaining.
Real GM Jorge Valdano praised Kaka afterwards: "He is a noble and great professional. He has had some basic groin problems and that's where all the other injury difficulties stem from.
"But he has been working morning, noon and night and the criticism on him has been unfair. Kaka has strong religious beliefs, but that has nothing to do with his delayed recovery. We should all respect that and not criticise him."