If you are needing to include a WP core file, then perhaps your template file is not actually a template file.
What does the URL look like to access this file / template?
Is it attached to a post?
Is it a custom page template? Or a post type template?