As the season kicked off without spectators due to the COVID-19 pandemic, Castrovilli tapped the ball home in the 78th minute at the far post to hand Torino's new coach Marco Giampaolo a losing debut.
Fiorentina gave midfielder Giacomo Bonaventura his debut following his move from AC Milan and Karol Linetty started for Torino after his move from Sampdoria as both teams looked to improve on indifferent performances last season.
Torino goalkeeper Salvatore Sirigu twice foiled Christian Kouame in the first half, blocking a header on the line before denying him again with an even better save.
Fiore's Cristiano Biraghi had a goal disallowed at the start of the season half before the home side, who finished 10th last season, finally broke through thanks to Castrovilli from a chance created by Federico Chiesa.
Andrea Belotti had the ball in the net for Torino deep into stoppage time with an acrobatic effort but it was disallowed for offside.