JUBILANT: Real Madrid's Casemiro celebrates a goal against Osasuna.
Bale had been left out completely for Madrid's previous four matches but the Welshman returned to the squad and the starting line-up at El Sadar, in a surprise show of faith from coach Zinedine Zidane.
A fortuitious deflection meant Bale assisted Isco's equaliser too before Sergio Ramos put Madrid in front after Unai Garcia had given Osasuna an early lead.
Substitutes Lucas Vazquez and Luka Jovic then scored from late breaks as Madrid pulled six points clear of Barcelona, who play away at Real Betis later on Sunday.
Barca's exit in the Copa del Rey overshadowed Madrid's own shock defeat at home to Real Sociedad in the quarter-finals, a loss that brought a dramatic end to their 21-match unbeaten run.
But Zidane will be relieved to see his team swiftly back on track with a performance full of the kind of resilience that Madrid's rivals have so lacked in recent weeks.
Bale also keeps coming back under Zidane and the 30-year-old had chances to add a goal to a spirited display before going off to a decent reception from the away support in the second half.
This was only his third appearance since the turn of the year.
Osasuna were the better side in the early stages and took a deserved lead when Unai put his head in front of Casemiro's dangling foot and steered the ball into the corner.
But Madrid improved as the half wore on and Isco volleyed in an equaliser after Bale attempted to divert Ferland Mendy's cross, with the ball deflecting kindly into the Spaniard's path.
Ramos was lucky to escape a red card after sliding in on Ruben Garcia with a high foot and Madrid's captain took full advantage of his reprieve as he nodded in Casemiro's looping header to the back post.
Luka Modric had a strong claim for a penalty after he nipped the ball away from Pervis Estupinan in the area before Osasuna enjoyed their most threatening spell.
Inigo Perez's shot whistled just over and Ruben dragged wide from Nacho Vidal's pull-back after making space with a neat dummy past Ramos.
Bale went off to applause from the small number of away fans, and Vazquez came on to add a third. Osasuna's defence were occupied by a Karim Benzema burst and he fed right for Vazquez to drive in. Jovic smashed in a fourth in injury-time.