Provide variable to page.tpl.php to mark page as Access Denied or 404?
If I uderstand your question perhaps try: Drupal 7 Custom 404 Page Template - use this method to setup a custom page template (tpl) file for your 404 page. This will give you a specific page template that you can hard code classes you're wanting - "access-404" or "access-denied" in the body tag.