Relegation-threatened Espanyol pulled off one of the upsets of the La Liga season when they faced rampant leaders Real Madrid.