Are my Dividends and Capital Gains earned from U.S. accounts and stocks all taxable to New York, where I am a nonresident? (I live in Germany)

I sold a few stocks for some profit (I think about $8000) and my bank account and stocks earned a little over $3000 in dividends. Must I pay taxes on the whole think in NYS?