The hosts' goalkeeper inexplicably punched the Portuguese's shot between his own legs, while the referee ignored an apparent foul in the lead up to the Argentine's strike
Cristiano Ronaldo fired a 35-yard free kick goalwards in the first half which Andres Fernandez - in a moment of madness - opted to punch, but the ball unexpectedly bounced downwards between his legs and into the net.
The hosts tried to drag themselves back into the cup tie, despite their fate looking all-but-sealed, but their efforts failed to seriously trouble Iker Casillas.
Carlo Ancelotti's men allowed the Rojillos to press early in the second half but killed the game off 11 minutes after the break when Angel Di Maria finished off a swift counterattack, though Xabi Alonso appeared to foul Osasuna's Miguel de las Cuevas in the build-up.
The victory sees Javi Gracia's men eliminated from the Spanish cup, while last year's runners-up Madrid - who had nine men left on the pitch at the end of the game due to Fabio Coentrao's sending off and Alvaro Morata's facial injury - will face Espanyol in the quarter-final stage.
The Blancos started slowly and looked disjointed in the final third, with Jese Rodriguez, Di Maria and Isco failing to put too many passes together.
Ballon d'Or winner Ronaldo was largely working on his own down the left wing, but was gifted a goal 21 minutes in when Fernandez punched his dipping free kick between his legs and in for the opener.
The hosts refused to lie down and take the defeat and Alvaro Cejudo's free kick kept Casillas on his toes when it dipped on to the roof of the net from 25 yards.
Roberto Torres definitely should then have done better when shooting from 12 yards inside Madrid's box, but his effort was weak and Casillas was able to slowly fall to his left to smother the soft strike.
After the break, the Rojillos persevered for a little while longer but their spirits crumbled with 56 minutes on the clock.
The referee refused to blow for what looked like a foul from Alonso on De las Cuevas, and the visitors counterattacked up the pitch via Jese, who crossed low and firm for Di Maria to thump in low into the bottom corner to seal the result with half an hour still to play.
Osasuna looked completely spent after the second goal and with the game over, Ronaldo was brought off for Bale as Ancelotti freshened things up.
Madrid substitute Casemiro should have made it 3-0 on the night but headed Di Maria's superb corner downwards and wide, while Morata picked up a nasty facial injury after landing on an Osasuna player's shoulder.
Coentrao picked up a deserved second yellow card late on for a poor tackle to reduce the visitors to 10 men and then Ancelotti saw his charges lose another man as Morata was unable to play on due to his injury.