La Liga: Cordoba 1 Real Madrid 2
Ronaldo was given a straight red card for kicking out at a Cordoba defender with the score deadlocked at 1-1 eight minutes from time at the Estadio Nuevo Arcangel on Saturday.
However, Bale spared his team-mate's blushes when he converted from the penalty spot in the 89th minute after his own free-kick had been handled - with Cordoba's Federico Cartabia receiving a second booking for that offence.
Real therefore move four points clear of Barcelona ahead of the Catalans' trip to Elche later on Saturday, but Carlo Ancelotti will be concerned by his side's performance and the fact Ronaldo - who cut a frustrated figure throughout the clash - could now face a three-game ban for violent conduct.
Real endured a dreadful start as Nabil Ghilas confidently converted from the penalty spot after Sergio Ramos handled Bebe's shot just three minutes in.
Cordoba's confidence continued to grow after they had taken the lead, with Bebe, Ghilas and Cartabia looking particularly threatening on the counter.
Manchester United flop Bebe almost put the hosts two goals to the good in the 18th minute, firing just wide of the post following a driving run into the penalty area.
Despite appearing somewhat rattled by Cordoba's bold approach, Real eventually restored parity through Benzema just before the half-hour mark.
The France striker stabbed home from close range after James Rodriguez's corner was flicked on by Bale.
Real struggled to build upon their equaliser, however, with their star-studded frontline having little luck carving out clear-cut chances against a well-organised Cordoba defence.
Ancelotti failed to inspire an improvement with his half-time words, as Cordoba remained just as threatening going forward.
In fact, the hosts appeared the more composed of the two sides in attack and went close twice in quick succession in the 56th minute.
Cartabia first smashed a fierce effort just wide of the top-left corner from 25 yards, before Bebe fired straight at Iker Casillas after a strong solo run.
Their best chance came 12 minutes later, though.
Florin Andone pounced on Raphael Varane's weak header and looped an effort over the approaching Casillas, but the ball bounced up and hit the bar.
Cordoba appeared set to earn a well-deserved point when Ronaldo was dismissed shortly after, but Bale was on hand to nick all three points with his late, late penalty.