The visitors took the lead against the run of play, as new signing Helder Postiga turned home Jonas's cross in the 10th minute.
Sergio Garcia missed a great opportunity to level the score in the 32nd minute, but the home fans did not have to wait much longer for the breakthrough as David Lopez powered home a header moments later.
The sides went in level at the break but Javier Aguirre's men were soon in front after the restart, Christian Stuani finding the net with his head this time.
Ever Banega came close to restoring parity just before the hour mark, but his arrowed effort whistled just by the post.
The visitors pushed for an equaliser but in doing so were left open at the back, allowing the home side to go searching for the killer goal, which came from Thievy Bifouma in the 89th minute.