The hosts were guaranteed to finish bottom of the table but failed to give their fans some much-needed pre-summer cheer as the Pamplona club hit back from an early deficit to win at a canter.
Christian Stuani handed Racing a second-minute lead but Ibrahima Balde, Alvaro Cejudo and Raul Garcia put Osasuna in charge
Jairo Samperio pulled one back but Osasuna had the final word courtesy of Roversio. The win meant Osasuna ended the season in seventh but results elsewhere ensured their bid to qualify for the Europa League ended in disappointment.
Racing started well and went ahead from their first attack, Jairo crossing from the right for Stuani to head home.
Osasuna threatened a swift response but Francisco Nino's effort was blocked by Alvaro Gonzalez while Balde's shot was straight at home goalkeeper Mario Fernandez.
The equaliser came 10 minutes into the second half as David Timor centred from the left for Balde to convert.
And Osasuna then went ahead after 68 minutes with Garcia's shot coming back off the post but Cejudo was on hand to convert the rebound.
Garcia got his name on the scoresheet three minutes later. His penalty - awarded for a foul by Gonzalez on Cejudo - was saved by Fernandez but the former Atletico Madrid midfielder nodded in the loose ball.
Lautaro Acosta played in Jairo to make it 2-3, but substitute Roversio clinched it by heading in Cejudo's cross.