Rayo Vallecano have not yet secured their La Liga safety after going down by a single goal in Mallorca.
Michu almost put the visitors ahead after a quarter of an hour, but his long-range effort fizzed just past the post.
Vallecano again came close soon after when Raul Tamudo struck the post as the visitors continued to pepper the Mallorca goal in the opening period.
Rayo were then made to pay for their missed opportunities in the 62nd minute when Gonzalo Castro put the home side ahead.
Tomer Hemed almost doubled Mallorca's advantage with 10 minutes remaining but watched his header drift just wide.
Vallecano are now just three points clear of Real Zaragoza above the drop zone with two games to play.