I'm surprised no one mentioned article 35.
http://codes.lp.findlaw.com/nycode/PEN/ONE/C/35/35.20
3. A person in possession or control of, or licensed or privileged to be in, a dwelling or an occupied building, who reasonably believes that another person is committing or attempting to commit a burglary of such dwelling or building, may use deadly physical force upon such other person when he or she reasonably believes such to be necessary to prevent or terminate the commission or attempted commission of such burglary.