I have vector file of say Sewer lines with diameter as their labels. Against some of the sewer, georef. images are placed. While displaying all together, line labels do appear over the raster file. I want to avoid that. I am using ArcGIS 10.5
I don't think that there is a direct solution. As a workaround, you should create vector polygons with the extents of your raster, add those polygon to your map (with a transparent symbology), and give a weight of 1000 to the interior and the boundary of your polygons to indicate that the feature should not be overlapped by labels.
As a remark, you probably have a few standard diameter for your sewer (e.g. 2.5, 3, 6, 8, 12), so a specific symbol could replace your labels (and you only use labels for the non standard values)