The closely-fought contest was brought to a halt for nearly seven minutes midway through the second half as Ferencvaros striker Varga received lengthy treatment on the pitch.
Varga, 29, appeared to be knocked unconscious after jarring his neck when his head smacked into the arm of Scotland goalkeeper Gunn as the Tartan Army defended a Hungarian free kick into the penalty box.
Hungary's players, who looked visibly disturbed after the collision, instantly called for medical support and quickly formed a border around Varga, before venting their frustration at the medics who ambled onto the pitch with a stretcher.
Sheets were held around Varga as he received treatment on the pitch, before he was helped onto a stretcher and carried away to a relieved round of applause from both sets of supporters in the MHPArena.
The Hungarian Football Federation have since confirmed to BBC Sport that Vargas is conscious, while they have also taken to social media to provide an update on the striker's situation and condition following the collision.
Hungary's Varga conscious and stable in hospital
A statement posted on X read: "Barnabas Varga's condition is stable. The Ferencvaros player is currently in one of the hospitals in Stuttgart. We will inform you immediately if there is any news about his status."
Varga, a 14-cap Hungary international, was starting his third successive game at Euro 2024 in the match with Scotland and was hoping to score his second goal of the tournament after netting in a 3-1 defeat to Switzerland on matchday one.
Play resumed in the 73rd minute following Varga's withdrawal, with Hungary and Scotland battling it out in an engrossing end-to-end contest between two teams seeking to score an all-important match-winner to keep their last-16 hopes alive.
Scotland wee controversially denied a late penalty when Willi Orban seemed to clatter into the back of Stuart Armstrong, before the fourth official indicated a minimum of 10 minutes of injury time.
Both teams pushed for a late winner, but it was Hungary who snatched maximum points in dramatic fashion, netting a 100th-minute goal thanks to a composed finish from substitute Kevin Csoboth following a swift counter-attack.
While Scotland have finished fourth in Group A and have subsequently been knocked out of Euro 2024, victory for Hungary has seen them leapfrog the Tartan Army into third place with three points, and they still have a chance of reaching the last 16 as one of the four best third-placed teams.
Elsewhere in Group A, Germany scored a 92nd-minute equaliser to draw 1-1 with Switzerland, meaning the Euro 2024 hosts top the group with seven points, finishing two points clear of the second-placed Swiss, who have also qualified for the last 16.