They surpassed the previous record of 263-5, set by Royal Challengers Bangalore in 2013
Cristiano Ronaldo opened the scoring in the first half, but Danilo levelled for the visitors soon afterwards.
Miralem Pjanic profited on a defensive mix-up to net Juve's winner after the break, continuing Maurizio Sarri’s unbeaten start as Juventus coach.
The champions are top on 22 points but second-placed Inter Milan can cut their lead to one point with victory at Sassuolo on Sunday.