This study aims to explore the Garcia-Salcedo ghost dark energy and generalized ghost dark energy models in the context of f(R,T2) theory, where R is the Ricci scalar and T2 is the self-contraction of stress–energy tensor. We investigate the non-interacting case only corresponding to flat Friedmann–Robertson–Walker universe. We reconstruct the corresponding f(R,T2) gravity models using the considered dark energy models by taking two particular models of this gravity. The stability analysis is performed for all the cases. The behavior of the equation of state parameter is also checked. It is found that some of the reconstructed f(R,T2) models successfully describe both the phantom and quintessence epochs of the universe, which support the current cosmic accelerated expansion. This exploration reveals the intricate connections between dark energy models and modified gravitational theory, providing significant understanding into the dynamics of the cosmos on a large scale.