Scotland scored two stunning stoppage-time goals to beat Denmark 4-2 and reach the World Cup for the first time since 1998.