Wales' penultimate game before the World Cup ended in a 2-1 Nations League defeat by Belgium in Brussels.
Kevin De Bruyne and Michy Batshuayi rewarded Belgium's first-half dominance with well-worked goals and Wales looked as if they may suffer a hiding.
But Kieffer Moore halved the deficit five minutes after the interval, and Robert Page's side produced a much-improved second-half performance to offer encouragement two months before the World Cup in Qatar.
De Bruyne had said before the game he was bored of playing Wales so much, but the Manchester City midfielder did not show it as he produced a masterful performance.
Wales started in confident fashion but fell behind after 10 minutes when Batshuayi's cross found De Bruyne and he casually guided it past Wayne Hennessey, who got a hand to the shot.
De Bruyne soon set up Belgium's second after 37 minutes, rolling a defender superbly and crossing for Batshuayi to convert the simplest of tap-ins.
Wales got back in the contest with a goal out of nothing.
Johnson twisted and turned his way towards the Belgium box with a mazy 40-yard run, and Moore rose at the far post to head home his cross in style.
Wales sent on Bale just after the hour mark and he was soon in the action, meeting a James cross that was deflected over.
Belgium were awarded a penalty for a foul on De Bruyne. But replays showed that Joe Morrell had made contact with the ball and the decision was overturned on VAR review.
Wales will head into their final Nations League game at home to Poland on Sunday with their survival hopes intact.
Poland's 2-0 home defeat to Holland means that bottom-placed Wales can leapfrog them with a Cardiff victory and remain in the top tier of European football.
Cody Gakpo scored early and Steven Bergwijn added a second to earn the Netherlands the away win and put them within one point of winning their Nations League group.
The unbeaten Dutch have now won four of their five League A Group Four games and are three points ahead of Belgium.
The Dutch need only a draw at home to Belgium in Amsterdam on Sunday to secure a place in next year's four-team Nations League finals.
Gakpo’s 13th-minute opener at the Narodowy Stadium came at the end of a slick passing move as the striker had only to tap home Denzel Dumfries’ inch-perfect square pass after the Polish defence has been prised apart.
Bergwijn doubled the lead in the 60th minute, coming in off the left flank to play a clever one-two with substitute Vincent Janssen and curling the ball expertly into the net.
France kept their hopes of staying in the top tier of the Nations League alive as goals by Kylian Mbappe and Olivier Giroud secured a 2-0 home victory over Austria on Thursday.
Mbappe produced a stunning strike before the 35-year-old Giroud sealed the win with a header to become the oldest player to score a goal for France.

The world champions, who travel to Denmark on Sunday, climbed to third in Group 1 with five points from as many games.
Victory came at a price, however, as defender Jules Kounde and goalkeeper Mike Maignan sustained injuries, and may join Karim Benzema, Hugo Lloris and Paul Pogba on the sidelines.
France coach Didier Deschamps was satisfied with the performance in front of an unusually enthusiastic crowd.
"We did what we had to do," the 1998 world champion said. "Our intentions were good, everyone defended a lot, there are a lot of positives. The mindset was good, it was a very good performance."
In the final League A game, Croatia substitute Lovro Majer scored a late goal as they beat Denmark 2-1 on Thursday to top Group 1 with the winner coming two minutes after visiting captain Christian Eriksen's superb equaliser.
Having beaten the Danes in Copenhagen in June, the Croatians repeated the feat to reach 10 points from five games, one ahead of Denmark in their bid for a Nations League semi-final spot.
Defender Borna Sosa, who was born in the Precko district of Zagreb and learned his trade at local club Dinamo before moving to VfB Stuttgart, had opened the scoring by slotting home from the edge of the area four minutes after the break.
Despite Denmark's attack misfiring for much of the night, a moment of magic from Eriksen looked set to secure a point as he fired home a brilliant dipping shot in the 77th minute.
The relief was short-lived though as Majer, who came on for Mateo Kovacic after Eriksen's goal, picked up the ball on the edge of the box and rattled it past keeper Kasper Schmeichel.