Filing a North Dakota non-resident tax return

I live in Minnesota and file a state tax return and also file a North Dakota non-resident return because I receive Royalties.  When filing in North Dakota you have to file both a ND Individual Income Tax Return along with the Non-Resident Tax Return.  My question is on the Inidividual Return it lets you take a subtraction for

Social Security benefit exclusion--thus lowering my North Dakota taxable interest.    Am I able to take this subtraction even though I am not a resident of North Dakota?  Thank you for any help you can offer!