Box 17 State

 I live in NJ and work in NY, box 17 on my W2 has a State Income Tax number, and box 15 says TOTAL STATE. Which state are the taxes in box 17 paid to? Where I live or where I work?

thank you