The Catalonian club won at the Bernabeu for the first time in history to further dent their hosts' hopes of a league title.
Casemiro powerfully headed in from Toni Kroos' deep cross from the right wing to give the hosts a first-half lead.Cristhian Stuani's penalty made it 1-1 after Sergio Ramos' handball and Girona's Portu then hit the crossbar.
Real Madrid left-back Marcelo responded to criticism on Instagram by apologising for his role.
Marcelo then replied to the post: "It’s all my fault. We move on!"
Eusebio Sacristan was reportedly on the brink of the sack but Girona, who earned a draw away to Barcelona in September, are now 15th and four points clear of the relegation zone.