Roma sink free-falling Juventus
The Norwegian nodded in a David Pizarro cross in stoppage time after a Francesco Totti penalty had cancelled out Alessandro Del Piero's fine opener for hosts Juve in the 51st minute.
The Turin side were down to 10 men when Roma scored the winner after goalkeeper Gianluigi Buffon was sent off in the 83rd minute for charging out of his area and fouling Riise.
The win saw Roma tighten their grip on third place with 38 points from 21 games, eight behind leaders Inter Milan, who face second-placed AC Milan in Sunday's high stakes derby.
Juve are five points further back in fifth after a sixth loss in eight league games deepened the troubles of coach Ciro Ferrara, who replaced Ranieri just before the end of last season.
"The victory was important because Juventus want to stay in the race for Champions League qualification and us winning puts them several points behind us. I'm not looking for revenge," Ranieri told Sky television.
The hosts had shown signs of recovering from recent woes, with Mohamed Sissoko's return from duty with Mali at the African Nations Cup strengthening their midfield.
They had the better of the first half but Amauri, Nicola Legrottaglie and Del Piero failed to nod home inviting balls into the area.
However, Del Piero did put them in front with a left-footed diagonal volley, after the ball ballooned off a defender, to score his first league goal of an injury-hampered campaign.
Totti, who replaced a limping Luca Toni in the fourth minute to make his first appearance following a month-long injury layoff, levelled after Fabio Grosso blocked Rodrigo Taddei in the area before Riise landed the killer blow.
"It's a difficult period, there's no use hiding it," Ferrara said. "Sometimes our defeats have been deserved, others not, but at this point we are a long way behind.
"I think the squad has the strength, character and personality to come out of this all together. In moments like these you have to be strong men and they are."
A section of Turin's Stadio Olimpico was closed during the match because of racist chanting by Juventus's ultra fans in an Italian Cup tie last week.
Earlier, strugglers Catania thumped Parma 3-0 at home to move up a place to stand third-from-bottom.
Giuseppe Mascara headed the Sicilians in front after 15 minutes shortly before missing a penalty and Jorge Martinez and Takayuki Morimoto then sealed victory with second-half goals.