They remain four points clear of the capital side with two games remaining and will wrap up the title if they beat Crotone at home next Sunday.
Before then, they face Lazio in Wednesday's Coppa Italia final.
Juve were ahead at Roma through Mario Lemina, but Daniele de Rossi, Stephan El Shaarawy and Radja Nainggolan kept Roma's slim hopes alive.
Massimiliano Allegri's side only needed a point to secure a record sixth league title in a row and looked in good shape to do it when Lemina tapped home Gonzalo Higuain's cross.
But De Rossi levelled from the rebound when Gianluigi Buffon parried Kostas Manolas' effort and El Shaarawy's deflected shot put Roma ahead. Nainggolan smashed in a third on the bounce and Juve rarely looked like coming back from that.
Juventus are still likely to win the title and will have the chance to win it in front of their own fans against struggling Crotone on Sunday.
They could actually be champions on Saturday if Roma lose at Chievo, and third-placed Napoli do not beat Fiorentina at home.
By that stage, Juventus will know whether they can still win the treble with the Champions League final against Real Madrid to come on 3 June.
Match ends, Roma 3, Juventus 1.
Second Half ends, Roma 3, Juventus 1.
Corner,  Juventus. Conceded by Wojciech Szczesny.
Attempt saved. Gonzalo Higuaín (Juventus) right footed shot from the centre of the box is saved in the bottom right corner. Assisted by Mario Lemina.
Substitution, Roma. Francesco Totti replaces Mohamed Salah.
Gonzalo Higuaín (Juventus) is shown the yellow card.
Gonzalo Higuaín (Juventus).
(Roma) wins a free kick in the defensive half.
Attempt missed. Emerson (Roma) left footed shot from outside the box is too high.
Medhi Benatia (Juventus) is shown the yellow card for a bad foul.
Foul by Medhi Benatia (Juventus).
Emerson (Roma) wins a free kick in the attacking half.
Delay over. They are ready to continue.
Delay in match Emerson (Roma) because of an injury.
Attempt missed. Leonardo Bonucci (Juventus) header from the centre of the box misses to the right. Assisted by Mario Mandzukic with a cross.
Corner,  Juventus. Conceded by Leandro Paredes.
Attempt blocked. Mario Lemina (Juventus) left footed shot from the right side of the box is blocked.
Attempt blocked. Gonzalo Higuaín (Juventus) right footed shot from the centre of the box is blocked.
Attempt blocked. Miralem Pjanic (Juventus) left footed shot from outside the box is blocked. Assisted by Dani Alves.
Substitution, Roma. Juan Jesus replaces Radja Nainggolan.
Substitution, Juventus. Claudio Marchisio replaces Juan Cuadrado.
Attempt blocked. Paulo Dybala (Juventus) left footed shot from outside the box is blocked.
Juan Cuadrado (Juventus) wins a free kick in the attacking half.
Foul by Clément Grenier (Roma).
Attempt missed. Paulo Dybala (Juventus) header from the centre of the box is close, but misses the top right corner. Assisted by Mario Mandzukic with a cross.
Kwadwo Asamoah (Juventus) wins a free kick in the defensive half.
Foul by Mohamed Salah (Roma).
Substitution, Roma. Clément Grenier replaces Diego Perotti.
Substitution, Juventus. Paulo Dybala replaces Stefano Sturaro.
Goal!  Roma 3, Juventus 1. Radja Nainggolan (Roma) right footed shot from the right side of the box to the bottom right corner. Assisted by Mohamed Salah with a through ball.
Foul by Gonzalo Higuaín (Juventus).
Federico Fazio (Roma) wins a free kick in the defensive half.
Substitution, Juventus. Dani Alves replaces Stephan Lichtsteiner.
Offside, Juventus. Mario Mandzukic tries a through ball, but Stefano Sturaro is caught offside.
Attempt blocked. Mario Mandzukic (Juventus) header from the centre of the box is blocked. Assisted by Juan Cuadrado with a cross.
Leandro Paredes (Roma) is shown the yellow card for a bad foul.
Medhi Benatia (Juventus) wins a free kick in the defensive half.
Foul by Leandro Paredes (Roma).
Corner,  Juventus. Conceded by Kostas Manolas.
Goal!  Roma 2, Juventus 1. Stephan El Shaarawy (Roma) right footed shot from the left side of the box to the bottom right corner. Assisted by Radja Nainggolan.

Sum: Juventus missed the chance to seal their sixth consecutive Serie A title as they lost to second-placed Roma.


Labour's Tracy Brabin was elected with an increased majority in the West Yorkshire seat of the late MP Jo Cox.
Although the other major parties opted not to stand, a number of smaller parties - including the National Front and BNP - did.
Mrs Brabin said: "We have shown that we stand together with one voice choosing unity and hope."
Describing her victory as "bitter sweet" she said she hoped Mrs Cox would have been "proud tonight of our community".
The former Coronation Street, Emmerdale and EastEnders actress was loudly heckled by some supporters of her rival candidates during her speech.
She said: "I am delighted more than anything that the fringe parties have lost their deposits.
"It is a positive endorsement from the people of Batley and Spen about what they are looking for and what they want from me, which is unity and bringing people together."
It would have been the political shock of all time if Labour had not retaken Batley and Spen with a huge majority and locally-born TV actress Tracy Brabin did not disappoint.
Labour party campaign managers had set themselves the twin objectives of ensuring a big turnout and that the nine candidates who put their names on the ballot paper from tiny fringe parties or standing as independents should be so badly supported they would lose their deposits.
The little known English Democrats' candidate, Therese Hirst, came a distant second but with less than a thousand votes she will not be getting her Â£500 back.
Neither will all the others who trailed behind her. But Labour was unable build on the undoubted swell of public outrage at the violent death of their MP.
The party's existing vote did hold up well but with overall turnout down to just over 25% from the 64% at last year's General Election, it looks as though the supporters of the other mainstream parties simply stayed at home.
Brendan Cox, Jo's husband, tweeted his congratulations: "Well done @Tracy4MP & great to see all the purveyors of hate lose their deposits."
Mrs Cox was shot and stabbed in Birstall on 16 June. A man has been charged in connection with her death.

Sum:
The newly-elected MP for Batley and Spen has described her win as a victory for "hope and unity".