Newton's Second Law (F=ma) is applicable only if you're working in the Inertial Frame of Reference (Earth or any other frame moving at a constant velocity wrt Earth). You don't even need D'Alembert Principle when working in this Frame.
However, when you're working in an Accelerating Non Inertial Frame of Reference, you apply D'Alembert Principle to negate the effect of a Virtual Force which appears to be working but is not there.
Consider the classic case of a Girl on Roller Skates standing in the aisle of a bus. When bus starts moving (Force on Bus only, not the Girl), the girl appears to be stationary if seen from the Earth. Because Earth is an inertial frame of reference, Newton's Second Law (F=ma) is applicable. No Force No Acceleration.
If an Accelerating Non Inertial Frame of Reference eg. Bus is used, to a man standing at the back of the bus, the girl would appear to accelerate towards him. This acceleration is due to a virtual force which is not present physically. This virtual force needs to be taken care of because the Net Physical Force on the Girl is Zero (Girl is not being pushed or Pulled inside the Bus), there should be no acceleration.
To find the actual Physical Force on the Girl, we need to subtract the Virtual Force (which is responsible for Girl's acceleration,af and is equal to the acceleration of the Frame of Reference, Bus). Using
F = m*(af + ar) or F - m*af = m*ar
where F = Net Physical Force on the Object
af=acceleration of the Frame of Reference (+/-)
ar=acceleration of Object relative to the Accelerating Frame (-/+)
m*af = Virtual Force
F=0 (which is what should be).
D'Alembert Principle is useless when working in an Inertial Frame of Reference (I don't think F=ma needs to be touched, it's as simple a principle as can be), D'Alembert Principle finds an application when working in an Accelerating Non Inertial Frame of Reference.
So, F-ma = 0 is hardly helpful (it's rather confusing), the only form in which it's helpful is F - m*af = m*ar.
While calculating Piston Effort, the Frame of Reference used is the system in which all the parts are operating and all the forces are internal to the system. Hence, Virtual Force is subtracted.