The victory, which sparked wild celebrations at the Iberostar stadium in Palma, lifted Mallorca off the bottom of the table above Celta Vigo, while denting Betis's hopes of overtaking sixth-placed Malaga.
With two games left, Mallorca have 32 points in 19th, one ahead of bottom side Celta and two behind 18th-placed Real Zaragoza, who were beaten 2-1 by Athletic Bilbao on Sunday.
"Our job is to win the last two matches and that's what we will try to do," Mallorca coach Gregorio Manzano said in an interview with Spanish television broadcaster Cuatro.
Granada (39 points), Osasuna (36) and Deportivo La Coruna (35) are all still threatened with the drop to the Liga Adelante (second division) as the season draws to a close.
Betis, in seventh on 52 points, two behind Malaga, remain on course to qualify for the Europa League as they have a three-point advantage over eighth-placed Rayo Vallecano.
Mallorca were close to taking the lead in the ninth minute when a Victor Casadesus header was brilliantly saved by Betis goalkeeper Adrian and Hemed followed up with a volley against the crossbar.
Casadesus forced another superb save from Adrian in the 17th minute and Hemed struck four minutes later when he was first to a rebound and sidefooted the ball into the net.
Mallorca's final two games are away at Atletico Madrid, who are already assured of third, and at home to mid-table Real Valladolid.
"If we can get the six points we will have a chance," Mallorca captain Pep Marti told Cuatro.
"Yes we can, yes we can," he added, echoing the cries of the home fans up in the stands.