The first quarter of an hour produced little goalmouth action of note as the two strugglers nervously settled into the game before Riera gave Osasuna the lead on their first notable venture forward.
The striker collected a clever pass from Alvaro Cejudo to thump into the roof of the net from inside the area for his 11th goal of the season and his second in as many matches.
In a game of few chances, it was Osasuna who continued to have the better of the opportunities after the interval as Cristian Lobato ran with the ball from deep before shooting narrowly wide from 20 yards.
Riera was forced off injured in the latter stages and his replacement Javier Acuna was on the receiving end of a nasty challenge from Rafita as Almeria tried to win the ball back to launch a late rally.
The midfielder was cautioned, and then shown another yellow card two minutes later for a rash tackle on Oier Sanjurjo, allowing the clock to run down and Osasuna to pick up three crucial points.
The result lifts Osasuna up to 14th in the table, while Almeria remain 19th, but only one point from safety, with only six points separating the Andalusian side from 11th-placed Celta Vigo.