Add following function into your functions.php
file:
function is_child_of() {
global $post;
return is_page() && in_array( $post->post_parent, func_get_args() );
}
And use it in your template like this:
if ( is_child_of( 5860, 1047 ) ) {
// is child of 5860 or 1047
}