Cammy Kerr gave the Dark Blues a half-time lead at the Kilmac Stadium at Dens Park but Gavin Price's men hit back after the break.
Rabin Omar equalised and Shane Sutherland quickly added a second goal for Elgin before Dundee had keeper Calum Ferrie sent off.