"Is this approach even possible?"
What you could do is make a fine resolution full screen "quad" that has it's verticies displaced in the vertex shader according to a lookup into your "depth buffer" texture.
That way, the perceived depth of your grayscale image will be written into the currently bound framebuffers depth buffer.
"I want to write a shader program to help me discard all the pixels(frags) which have the depth smaller than current depth."
You don't need to do this, just use OpenGL's depth test.
"What value to compare with the depth value?"
OpenGL does this for you, provided you enabled depth testing.
Edit:
And of course, the displacement in the vertex shader should approach the camera.
I think the vertex shader should look a bit like this:
attribute vec3 vert;
attribute vec2 uv;
uniform sampler2D depthTexture;
uniform float mapRange; //you will probably need to change this value for every scene
void main() {
float displacement = texture2D(depthTexture, uv).w*mapRange; //preferably, for the texture you want single channel 32 bits, dunno if ES supports that though
gl_Position = vec4(vert, 1)+vec4(0, 0, -displacement , 0); // the displacement moves along the negative z axis, which afaik is towards the camera.
}
Fragment shader:
void main() {
gl_fragColor = vec4(1);
}