Canon S120 has a 12.0MP 1/1.7" (7.44 x 5.58 mm ) sized BSI-CMOS sensor and features Digic 6 processor. On the other hand, Nikon 5400 has a 5.0MP 1/1.8" (7.144 x 5.358 mm ) sized CCD sensor . Canon S120's sensor provides 7MP more than Nikon 5400's sensor, which gives a significant advantage in real life. You can print your images larger or crop more freely.
On the other hand, please keep in mind that Max sensor resolution is not the only determinant of resolving power. Factors such as the optical elements, low pass filter, pixel size and sensor technology also affects the final resolution of the captured image.
Below you can see the S120 and 5400 sensor size comparison.
Canon S120 and Nikon 5400 have almost the same sensor size so none of them has any significant advantage over other in providing control over depth of field when used with same focal length and aperture.