Tomer Hemed should have done better after 15 minutes, but his effort from inside the area went wide of the post.
In a lacklustre first half for the visitors, Cristiano Ronaldo's tame free kick on 33 minutes was Madrid's first meaningful effort on goal.
Sergio Ramos almost grabbed an equaliser for the away side at the end of the half, but his header hit the post from Xabi Alonso's free kick.
Karim Benzema blasted a volley over the bar at the start of the second half, while Hemed put a headernarrowly wide.
Madrid were level with 20 minutes to play thanks to Gonzalo Higuain's deflected finish after he was put through by Mesut Ozil.
As their dominance grew, Ronaldo came close minutes later when his spectacular drive crahsed back off the crossbar.
Ramos had another header ruled out for offside with 15 minutes to go before Callejon's 88th-minute strike fired Madrid in front after Mallorca had failed to clear.