How can I insert a template into base.php when using a custom rewrite rule?

From context cues I’m guessing you’re using Sage 8. If you were in Sage 9 I would recommend a @stack (see details here). With 8 you could probably get away with a conditional and get_post_type.