You have to register custom texonomy. Add below code in your functions.php. Ref
//hook into the init action and call create_question_taxonomies when it fires
add_action( 'init', 'create_question_taxonomies', 0 );
//create two taxonomies, genres and writers for the post type "question"
function create_question_taxonomies()
{
// Add new taxonomy, make it hierarchical (like categories)
$labels = array(
'name' => _x( 'q-categories', 'taxonomy general name' ),
'singular_name' => _x( 'q-category', 'taxonomy singular name' ),
'search_items' => __( 'Search q-categories' ),
'all_items' => __( 'All q-categories' ),
'parent_item' => __( 'Parent q-categories' ),
'parent_item_colon' => __( 'Parent q-categories:' ),
'edit_item' => __( 'Edit q-categories' ),
'update_item' => __( 'Update q-categories' ),
'add_new_item' => __( 'Add New q-categories' ),
'new_item_name' => __( 'New q-categories Name' ),
'menu_name' => __( 'q-categories' ),
);
register_taxonomy('q-categories',array('question'), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'q-categories' ),
));
}
Then you just add below code after wp_insert_post
wp_set_post_terms( $post_id, array( 'term', 'terms', 'terms' ), 'q-categories' );