Emergent gravity from vanishing energy-momentum tensor