The win leaves Robert Page’s Wales in sight of their first appearance in the finals for 64 years.
Bale produced two stunning strikes – one in each half – before Wales had to endure anxious moments after Marcel Sabitzer’s deflected effort halved the deficit.
Wales will now play Scotland or Ukraine for a place at the 2022 World Cup finals in Qatar.
That play-off semi-final is now expected to be played in June, with the final set to follow later the same month.
Bale came into the game with doubts over his fitness after missing Sunday’s El Clasico between Real Madrid and Barcelona.
He also knew that, with his 33rd birthday fast approaching, this year’s World Cup acts as the last chance of him appearing on football’s biggest stage.
But he stood up when his country needed him, extending his own goals record for Wales to 38 in 101 games.
Bale had not scored a free-kick for his country since beating England’s Joe Hart at Euro 2016.
But Lindner was reduced to the role of spectator as Bale’s shot whistled past him and into the top left-hand corner of his net, kissing the underside of the bar on its way in.
Bale doubled Wales’ lead six minutes after the restart following a short corner routine.
Ben Davies touched on James’ cross and Bale adjusted his feet superbly to lash the ball past Lindner.
Wales were punished when Sabitzer’s 64th-minute effort deflected off Davies to leave Hennessey helpless but they held on for a famous win.