Rewrite the first equation as
$$Y^{\frac{\rho-1}{\rho}} = Y_s^{\frac{\rho-1}{\rho}} + Y_g^{\frac{\rho-1}{\rho}}. $$
Divide both sides by $Y_s^{\frac{\rho-1}{\rho}}$ to obtain
$$\left(\frac{Y}{Y_g}\right)^{\frac{\rho-1}{\rho}} = 1 + \left(\frac{Y_s}{Y_g}\right)^{\frac{\rho-1}{\rho}}.$$
Substitute the price-ratio and production-ratio relationships as in your second equation and make some algebraic changes, and you will get your last equation. Note: I interpreted ``the price of $Y$ normalized to $1$'' as $\frac{p_g}{p_Y} = p_g= \left(\frac{Y}{Y_g}\right)^{\frac{1}{\rho}}$.