After doing your Federal return, prepare a Connecticut non-resident return, then prepare a New York resident return. You will get credit on your New York tax for some or all of the Connecticut tax. That's why you do the CT one first (so you will know the CT tax).