Ivan Schranz scored the only goal of the game in the seventh minute, expertly converting a volley from an acute angle to hand one of the minnows of the tournament a surprise lead.
Belgium wasted numerous opportunities to level, but it was two interventions from VAR that prevented Domenico Tedesco extending his unbeaten record as head coach to 15 games.
Romelu Lukaku had a goal ruled out for a marginal offside call, before a second was disallowed with four minutes left, a result of the ball innocuously flicking the fingers of Lois Openda in the build-up.
As a result, Slovakia join Romania - who stormed past Ukraine earlier in the day at the top of Group E, with Belgium left with a fight on their hands just to make the last 16.
Schranz composure the difference in first half
Lukaku was heavily involved during the early stages, being denied an early opener through a fine Martin Dubrvaka block, before the Chelsea forward breaching the offside trap led to Slovakia scrambling to keep the ball out.
There felt an inevitability about an early Belgium goal, yet it was Slovakia who went ahead after seven minutes through a well-taken volley from Schranz.
After Jeremy Doku had given possession away, Juraj Kucka saw a first-time effort parried into the air by goalkeeper Koen Casteels, only for the ball to go straight to Schranz who expertly found the far bottom corner from an acute angle.
Schranz's goal was Slovakia's earliest ever at a major tournament, yet it was Belgium who remained very much in the ascendancy, Leandro Trossard firing over when he should at least hit the target after goalkeeper Dubravka had inexplicitly passed the ball to a Belgium player 20 yards away.
With six minutes of the first half remaining, though, Slovakia came close to doubling their lead. A cross from the right floated its way to Lukas Haraslin, whose well-struck volley was parried away from danger by Casteels.
Wasteful finishing, VAR cost Belgium after break
Rather than beginning the restart defending their lead, Slovakia were prepared to continue showing ambition going forward, albeit without coming close to a second.
However, on the 56-minute mark, Belgium thought that they had equalised. Amadou Onana's header at the back post was perfect for Lukaku to slide home from almost on the goalline, but the frontman was marginally offside.
Dubravka then had to be alert to deny Trossard, while Lukaku fired into the side-netting soon afterwards. Substitute Johan Bakayoko then had a shot cleared off the line by David Hancko, who took a blow to the face for his troubles.
As the match approached a conclusion, Belgium's threat became less sustained than it was, but with five minutes remaining, it appeared that Tedesco's side had found the equaliser that they probably deserved.
Lukaku swept a fine first-time finish into the net from 15 yards out, there seemingly being little threat of it being disallowed, but VAR ruled out that the fingers of Openda had made contact with the ball in the build-up.
To the letter of the law, it was the correct decision, yet there was nothing intentional about the contact in what was a common tussle on the flank.
In seven minutes of added-on time, Belgium ploughed forward with Kevin De Bruyne seeing a low effort comfortably claimed by Dubravka, the Red Devils becoming increasingly desperate.
But that proved to be Belgium's final opportunity of an absorbing contest, the Red Devils now in a position where another defeat could see them exit a major tournament at the group stage for the second time in succession.
When do Belgium, Slovakia play again at Euro 2024?
Slovakia have the chance to wrap up progression to the knockout rounds on Friday when they square off against Ukraine, who cannot afford a second defeat.
Meanwhile, Belgium now have to wait until Saturday evening to try to get their campaign back on track, aware that losing to Romania would put them on the brink of an exit.