A drab match with little quality on display seemed destined to finish goalless until Abella Damia felled Jose Fernandez in the area and Larrivey stepped up to place his spot-kick in the bottom left-hand corner of the net.
The result will see Rayo climb several places in the congested lower reaches of the table, while Osasuna hover just above the drop zone, knowing they will drop into it if either Getafe or Real Valladolid can pick up a result on Thuesday.
They did little here to suggest they deserve otherwise.
Chances were hard to come for both sides, the first effort of note being a long-range effort from Rayo's Yago Falque which drifted wide in the 22nd minute.
Robert Torres sent a shot over at the other end, and neither goalkeeper had a save to make until Osasuna stopper Andres Fernandez did well to keep out another long-range effort from Alberto Bueno late in the half.
Rayo had perhaps their best chance 10 minutes into the second half when Fernandez was called upon again, pushing clear Alejandro Galvez's close-range header after a corner.
The ball went out for a second corner, but this time Ruben Rochina fired wide.
Ruben Martinez was having a quiet night of it in the Rayo goal, but warmed his palms as he held on to Francisco Silva's shot on the hour mark before Jordan Loties blazed wide .
He made a better save in the 69th minute to push away Alvaro Cejudo's shot before Alejandro Arribas headed over from the resulting corner.
Roberto Trashorras sent a shot straight at Fernandez as the game moved into the final 10 minutes, which passed without incident until Fernandez went down and Larrivey settled it.