Work in NY, live in NJ. Why are cap gains (stocks) showing as taxable in NY? I tried allocating $0 to NY but "Additional income taxed by NY" line still shows the amount

Both cap gains and dividends seem to show up here.  I'd like to exclude from my NY non-resident return but am unable to do so (even after a call with a TurboTax specialist).  Please advise.