Both Panasonic S5 and Sony A9 have Full frame sized 24.0 MP resolution sensors so sensor size and resolution is not a differentiator between these two cameras.
Another difference between these two cameras is that Panasonic S5's sensor lacks anti-alias (Low-Pass) filter. Removing anti-alias filter increases the sharpness and level of detail but at the same time, it increases the chance of moiré occurring in certain scenes.
Below you can see the S5 and A9 sensor size comparison.
Panasonic S5 and Sony A9 have the same sensor sizes so they will provide same level of control over the depth of field when used with same focal length and aperture.
DxOMark Sensor Scores
Both Panasonic S5 and Sony A9 sensors have been tested by DxoMark. DxoMark scores camera sensors for color depth (DXO Portrait), dynamic range (DXO Landscape) and low-light sensitivity (DXO Sports), and also gives them an overall score. Of the two cameras that we are comparing, S5 has scored 94, 2 points higher than A9.