Disclosure: I am not an attorney, you need one. I do not work in your area. What follows is just my 2 cents, which is worth, about, 2 cents.
1. You must have known about the dog when you put the offer in, so what's changed?
2. Did you pick your home inspector? Doesn't matter what your friend says unless you're still in the home inspection period.
Unless you can negotiate otherwise, you could lose more than your deposit. It's back to the negotiation table. I don't know about in NY, but in VA they can wait 5 years before filing a lawsuit against you, and can hold you liable for any additional costs to them as a result of your default.
Having said all of that - do you have any contingencies left in your contract? CALL YOUR AGENT.