as par as i know, if employees are more than 20 then establishment need to obtain PF code.
in ur case
1. it is advisable to get registered under PF act
2. if Sub contractor failed to do so, then it is the responsibility of principal employer to deduct EPF, and ESI
3. in case of inspection PF inspector will question principal employer not sub contractor.
Practically , PF inspectors wont give you a chance once you are in default...
in addition to that pf late payment interest and penalty ranging b/w 17- 37 % depending on the delay of deposit of PF.
even if you want to make it illegally also , wont solve your problem in a long time.
So, my advise is to register sub- contractor under PF and ESI act. its better to register under sub contractor instead of contractor paying sub contractor's employee EPF n ESI.