In my opinion, it is the responsibility of the Principal Employer to ensure that all payments are made to the Employee, even when they are under contract. Consequently, the Principal Employer will become liable for the payment of Gratuity as well.
Section 10 of the Payment of Gratuity Act
"Where an employer is charged with an offense punishable under this Act, he shall be entitled, upon a complaint duly made by him and on giving the complainant not less than three clear days' notice in writing of his intention to do so, to have any other person whom he charges as the actual offender brought before the court at the time appointed for hearing the charge. If, after the commission of the offense has been proved, the employer proves to the satisfaction of the court:
(a) that he has used due diligence to enforce the execution of this Act, and
(b) that the said other person committed the offense in question without his knowledge, consent, or connivance, that other person shall be convicted of the offense and shall be liable to the like punishment as if he were the employer, and the employer shall be discharged from any liability under this Act in respect of such offense."
Therefore, you must give notice to the Contractor and ensure the payment of Gratuity.
I hope this answers your query.
Regards,