draw a line on a plane

hi friends,

        i would like to draw a line on a surface ,where it should show the depth..i'm having on the two vertex for line..

eg : glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(2.0f,0.0f,0.0f);

In this image the line is drawn with depth…

According to the dynamically generated vertex i want to draw on the surface…help me regarding this