wp_insert_post featured image from library

You can use the function set_post_thubmnail().

After you inserted your post, just call this one, and you are ready to go.

$yourpostid = wp_insert_post( $args ); // Define the post in the args first
set_post_thumbnail( $yourpostid, $thumbnail_id ); // set the ID of your thumbnail to be the featured image of your newly created post.