There is no such thing as the "impedance of the whole circuit". You can ask about the input impedance at port 1 or at port 2. You could convert your y parameters to z parameters to give a matrix of impedance and transimpedance parameters. But talking about the "impedance of the whole circuit" makes no sense.
Can I use this expression to find impedance of a whole circuit? That is, to express I2 as I2=Ig-V2/4 and plug that into above equation.
Not without also knowing what's attached to port 1. The input current at I2 doesn't just depend on what's at port 2, it also depends on what's connected to port 2, because the VCVS will generate a current if there's a nonzero voltage at port 1.
If you have some fixed circuit connected to port 1 you could cascade your given 2-port together with it to form a composite 1-port device, and use whatever techniques are convenient to find the Thevenin or Norton equivalent of that device. This could involve converting the two-port description to T or ABCD-parameters, combining it with the source device, and then convverting back to Y or Z parameters.