On the equivalence between the effective cosmology and excursion set treatments of environment