Real Madrid, who missed a first-half penalty, wasted a golden opportunity to widen the gap at the top of the table after second-placed Sevilla stumbled at home with a draw against Celta Vigo on Saturday.
Real have 50 points from 22 games, four ahead of Sevilla.
Elche opened a two-goal lead with their only two shots on target as Lucas Boye netted in the first half and Pere Milla scored after the break.
Luka Modric reduced the deficit with a penalty after 82 minutes and Vinicius Junior found Militao inside the six-yard box in the 92nd minute and he headed the equaliser.
Real dominated from the beginning and were denied on three occasions by Elche keeper Edgar Badia, who made fine saves to keep out shots from Karim Benzema, Toni Kroos and Vinicius Jr in the first half.
Benzema missed a penalty with his effort going a few inches over the crossbar after Vinicius was fouled inside the area.
It was Benzema's first penalty miss in almost 13 years as a Real player, after converting all 16 of his previous efforts for the club.
Elche stunned Real with Boye heading home a cross from Fidel Chaves after a lightning-quick counter-attack from the left touchline right before the break.
The visitors kept Real Madrid out for 80 minutes, until the video assistant referee spotted a handball from Milla inside the area and Modric stroked the ball home from the spot.
After Benzema went off injured in the second half, Real looked to Vinicius to provide them with their creative spark and he set up the leveller for Miltao to rescue a point for the hosts.
"We have to be happy with the result because we were losing 2-0. Our team showed guts and will to fight back," Real's Lucas Vazquez told reporters.