The Welshman returned from injury as he came off the bench to win a spot-kick after stumbling under a challenge from Weligton in injury time. The penalty looked soft, with Bale making the most of minimal contact, but Cristiano Ronaldo stepped up to fire past the outstanding Willy Caballero who had kept Real at bay with a string of saves.
Real had taken the lead just after half-time as Angel Di Maria’s cross, intended for Ronaldo, eluded everyone to finish up in the far corner.
Alvaro Morata earned a start for the Merengues upfront in place of the injured Karim Benzema. There was also a start for Isco against his former club, while Diego Lopez continued in goal.
Malaga started in confident fashion but Ronaldo almost gave Real an early lead as he let fly with a glorious curling effort that smacked against the crossbar and out to safety after only seven minutes.
Di Maria played in Ronaldo who fired a left-footed effort inches wide of the far post with just Willy Caballero to beat as Real continued to go in search of an early lead.
Ronaldo's low shot looked bound for the corner until it was pushed away by Caballero before the overworked Uruguayan goalkeeper stuck out a hand to stop Morata’s header at point blank range.
Malaga continued to find themselves under the cosh, but reached half-time at 0-0 and could even have gone ahead as Eliseu found himself unmarked, only to lash a left-footed effort wide of the far post when he really should have tested Diego Lopez.
Real took the lead moments after half-time. Di Maria crossed for Ronaldo but his ball eluded everyone, including Caballero, and finished up in the far corner.
Ronaldo let rip with a well struck shot that was too hot to handle for Caballero, who could only parry the ball away. Morata then rose to head a corner just wide of the far post, with Ronaldo stretching to make contact.
Ronaldo's fierce free-kick was beaten away by Caballero and the Uruguayan made another instinctive save with his feet to deny the same player after substitute Jese had found him in the area.
Caballero added to his list of amazing saves as he dived to stop a shot from Jese and also tipped a rasping drive from Marcelo over the bar.
After one of the outstanding goalkeeping performances of the season, it was rough justice that Caballero should concede a second.
But after Bale had gone down under a challenge from Weligton, the referee pointed to the spot and Ronaldo showed no remorse to put daylight between the teams and give a more realistic slant to the scoreline.