Confused about non-resident reurn

I live in New York and work for a company based in Connecticut. It was a W-2 job, and my taxes were withheld toward CT state. I added my W-2 and calculated the credits toward the NY bill, but when I go to file CT taxes, it says that I owe $500 to CT.
I'm confused because it means I must pay taxes in both states. Is this the case? If not, how do you do it properly?