The song that was nearly passed over transformed the film’s ending into an unforgettable coming-of-age finale.