Carlo Ancelotti's side began confidently having won their last five league games, scoring 24 goals in the process, but were undone by two first half headers from Oriol Riera.
Sergio Ramos, returning from suspension and whose discipline has been questioned, was red carded after 43 minutes but Isco gave Real hope with a strike on the point of halftime.
Bale was taken off 10 minutes into the second half as they searched for an equaliser that eventually came from a Pepe header after Osasuna were also reduced to 10 men with Francisco Silva dismissed.
Bale, a 100 million euros signing, scored a hat-trick in his last league game against Valladolid but was unable to make an impact against Osasuna who also managed to earn a draw against Barcelona earlier in the season.
Later Barcelona can go three points clear at the top if they beat Villarreal with Atletico Madrid, level on 40 points playing on Sunday. Real are third with 38 points.
Image: Cristiano Ronaldo (right) of Real Madrid CF competes for the ball with Jordan Loties (left) of CA Osasuna during the La Liga match
Photograph: Gonzalo Arroyo Moreno/Getty Images
EPL PHOTOS: Manchester City slickers hit Arsenal for six, Chelsea win
Indians need to get out of mental block: Gibbs
No sex before games? Brazilian players test club controls
Asian Games, CWG can help Indian athletes gauge standing: Sania
La Liga: Gareth Bale scores his first hat-trick for Real Madrid