You'll have to file a non-resident NY return showing zero NY income in order to get a refund of those incorrectly withheld NY taxes.
I'm assuming you're not a telecommuter for a NY firm. NY is one of a handful of states that tax out-of-state telecommuters.
**Answers are correct to the best of my ability but do not constitute tax or legal advice.