The basic answer is yes, the gain is part of NJ income. NJ taxes its residents on all income, no matter where the source of that income might be.
When doing your state returns, complete your NY IT-203 first. Then complete your NJ-1040. On NJ Schedule A/B you can claim a credit for most of the NY tax you paid on the gain. I say most because the credit is based on NJ tax rates, which are a bit lower than the NY rates.