But they lost their lead due to a moment of madness from keeper Masip, who let a tame free kick from Roberto Lopez slip through his hands and over the line on the hour mark.
Elsewhere, Real Betis beat Alaves 1-0 in their first game of the La Liga season courtesy of an stoppage time goal from Cristian Tello, giving coach Manuel Pellegrini a winning start in his first game in charge of the Seville club.
Tello collected a pass following a short corner and cut inside on the edge of the area to unleash a left-footed strike which crept inside the near post.
Veteran goalkeeper Claudio Bravo made an impressive debut for Betis on his return to Spain after four years with Manchester City and did well to keep out a header from Alaves' Rodrigo Battaglia early in the second half.
Sergio Canales had come closest for Betis with a powerful free kick which hit the crossbar before teeing up Tello for the decisive late goal.