First-half goals from Kennedy Bakircioglu and Markus Rosenberg set the hosts on their way and, after Javad Nekounam had pulled one back from the spot, further strikes from Rosenberg and former Espanyol defender Marc Torrejon sealed the win.
The Cantabrians had lost five of their opening eight matches and came into this match in 18th place.
The northerners had also lost 2-0 to Segunda Division Cordoba in the Copa del Rey on Wednesday and pressure was increasing on coach Miguel Angel Portugal ahead of this match.
Nevertheless, Portugal claimed he was fully focused on this match and the coach will have been pleased with the reaction of his players.
There were chances for both sides early on, but Racing were the better team and, after Rosenberg came close midway through the first period, his fellow Swede Bakircioglu gave the hosts the lead with a brilliant free-kick three minutes later.
Tono made a fine double save to deny Osasuna at the other end straight afterwards.
And Rosenberg took advantage to make it two with a precise finish from outside the box after 35 minutes.
Racing could have put the game out of reach before the interval, but it was Osasuna who scored next after Torrejon handled in the area.
Nekounam converted from the spot to reduce the home side's lead after 57 minutes.
But Rosenberg made it 3-1 shortly afterwards following Torrejon's lay-off, and the ex-Espanyol man added the fourth six minutes from time when he glanced home from a corner.
The win moved Racing up to 12th, one place above Osasuna.