It is the first time Toulon have lost at home this season, and the result cuts their lead over Clermont to four points.
Jonathan Wisniewski opened the scores then brought the visitors equal again following two penalties from Jonny Wilkinson.
Wilkinson, who left the field to receive stitches after clashing heads with Benjamin Fall, notched a third penalty on his return to take the home side 9-6 up at half-time.
After the break, Chavency scored a neat try after a pass from centre Fabrice Estabanez, and Wisniewski converted before taking another two penalties while Wilkinson nabbed another during the final minutes.
The result puts Racing in eighth place in the Top 14 table on 34 points while Toulon remain first on 57 points.