Léo Scienza scored a 95th-minute winner to preserve Heidenheim's top-flight status and leave Elversberg in the second tier in a dramatic play-off second leg.