The Serie A leaders went a goal down to the Bulgarian club when Irish midfielder Graham Carey scored in the 10th minute .
But they hit back strongly with goals from Lorenzo Pellegrini and Stephan El Sharaawy before the break.
Pellegrini bagged his second after half-time before any hopes of a Sofia comeback ended when Yanic Wildschut was sent off for a second yellow card.
The home side capitalised, Gianluca Mancini netting before Tammy Abraham completed the rout.
Germany’s Union Berlin lost 3-1 to Slavia Prague on their European debut after playing the whole second half with 10 men.
Gibraltar had its first team in a European group stage as Lincoln Red Imps lost 2-0 at home to Greece’s PAOK.