Instead of serving a 404 Not Found error with the 404.php template,
send a 403 Forbidden error and set $wp_query->is_403 and load
403.php if it exists.
All in One Content Restriction - A simple and user-friendly plugin to restrict users/visitors from viewing posts by restricting access, as simple as that.