Zinedine Zidane made 10 changes to the team that beat the Bundesliga champions by the same scoreline on Wednesday and was rewarded with a well-timed goal from Bale, who may have done enough to hold his place for Tuesday's semi-final second leg.
There were few others who made a compelling case, though, as Los Blancos delivered a largely underwhelming performance, doing just enough to go unbeaten in eight LaLiga games and move within a point of second-placed Atletico Madrid.
Bale's early opener came via an initial attempt from Karim Benzema before Borja Mayoral - leading the attack in the absence of Cristiano Ronaldo - doubled the advantage in first-half stoppage time.
Leganes, who had skipper Gabriel Pires sent off after the final whistle, knew they only needed a point to confirm their LaLiga status for another season and looked as though they might get it after Darko Brasanac pulled one back with just under 25 minutes remaining.
Zidane's men recovered a measure of composure after that wake-up call and saw out a victory that keeps them ticking over ahead of the bigger challenges to come, including next Sunday's trip to Barcelona, whom they now trail by 12 points with four league fixtures remaining.
Bale only needed eight minutes to make his audition count, albeit in contentious fashion.
There was a hint of offside as the winger acrobatically volleyed the opener through Ivan Cuellar's legs at close range, Benzema's initial effort having broken kindly in the box.
Leganes steadied after the early setback and went agonisingly close to an equaliser midway through the half as Gabriel's flick-on header brushed the base of the far post.
Chances followed at either end soon after that near miss with Miguel Angel Guerrero first failing to properly connect with a backheel finish, before Mayoral had an attempt scrambled off the line.
The visitors continued to threaten in their attacking forays and clipped the woodwork for a second time shortly before the interval, Nordin Amrabat grazing the top of the crossbar with an inventive toe-poke.
Yet, on the stroke of half-time, their hopes of securing an unlikely result took another hit. Mayoral ghosted in at the far post and tapped in a corner that had skimmed off the head of a Leganes defender.
An unmarked Guerrero passed up a big opportunity to reduce the deficit immediately after the interval when he mistimed a header from Nabil El Zhar's cross.
Zidane moved to further safeguard against injuries by withdrawing Benzema – another contender to replace the sidelined Isco on Tuesday – meaning Bale took over the captain's armband for the final half hour.
But there was little the winger could do to prevent team-mate Achraf Hakimi from gifting Leganes a way back into the contest in the 66th minute, the young full-back switching off as he allowed Brasanac to tap home Amrabat's pass across the face of goal.
Kiko Casilla, standing in for Keylor Navas, then clawed away a stretching effort from Unai Bustinza to preserve an increasingly uncertain Madrid lead.
But there was only frustration to come for Asier Garitano's men as Gabriel was dismissed after confronting referee Ignacio Iglesias Villanueva over his decision to blow for full-time just as a shot beckoned.
Key Opta stats:
- Gareth Bale has scored 15-plus goals in four of his five seasons for Real Madrid in all competitions (82 in total).
- The Wales star has scored three goals in his three appearances against Leganes in La Liga, coming all three goals at Santiago Bernabeu.
- Real Madrid have not lost any of their past eight La Liga games (W6 D2), their best unbeaten run this season.
- Real Madrid attempted 12 shots against Leganes, their lowest tally in a La Liga home game this season.
- Borja Mayoral has scored five goals from his last nine shots on target for Real Madrid in all competitions.