I present a generalized power-law diagnostic that allows to identify the presence of active galactic nuclei (AGN) in infrared (IR) galaxies at z>1, down to flux densities at which the extragalactic IR background is mostly resolved. I derive this diagnostic from the analysis of 174 galaxies with Snu(24)>80 microJy and spectroscopic redshifts zspec>1 in the Chandra Deep Field South, for which I study the rest-frame UV/optical/near-IR spectral energy distributions (SEDs), after subtracting a hot-dust, power-law component with three possible spectral indices alpha=1.3, 2.0 and 3.0. I obtain that 35% of these 24micron sources are power-law composite galaxies (PLCGs), which I define as those galaxies for which the SED fitting with stellar templates, without any previous power-law subtraction, can be rejected with >2sigma confidence. Subtracting the power-law component from the PLCG SEDs produces stellar-mass correction factors <1.5 in >80% of cases. The PLCG incidence is especially high (47%) at z=1.0-1.5. To unveil which PLCGs host AGN, I conduct a combined analysis of 4Ms X-ray data, galaxy morphologies, and a greybody modelling of the hot dust. I find that: 1) 77% of all the X-ray AGN in my 24micron sample at z=1.0-1.5 are recognised by the PLCG criterion; 2) PLCGs with alpha=1.3 or 2.0 have regular morphologies and T_dust >~1000 K, indicating nuclear activity. Instead, PLCGs with alpha=3.0 are characterised by disturbed galaxy dynamics, and a hot interstellar medium can explain their dust temperatures T_dust ~700-800 K. Overall, my results indicate that the fraction of AGN among 24 micron sources is between ~30% and 52% at z=1.0-1.5.