You can use the update_post_meta function to insert the Yoast Plugin data. Yoast uses 3 post meta keys for each post:
- _yoast_wpseo_title ( use for SEO title )
- _yoast_wpseo_focuskw (For meta keywords )
- _yoast_wpseo_metadesc (For meta descriptio )
You can find all these meta key under postmeta table
$new_id = wp_update_post($array);
update_post_meta( $new_id, '_yoast_wpseo_title', 'SEO Title' );
update_post_meta( $new_id, '_yoast_wpseo_focuskw', 'keyword1 keyword2' );
update_post_meta( $new_id, '_yoast_wpseo_metadesc', 'SEO Meta Descr' );
Hopefully, It will work for you!
Thanks