I figured it out thanks to Pieter’s comment:
In functions.php
I added:
function tag_filter($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ($query->is_tag) {
$query->set('post_type', array( 'custom_post_type', ));
}
}
}
add_action('pre_get_posts','tag_filter');