Something like this:
local we1,wx1,wy1,wz1,e1 = processLineOfSight(sx,sy,sz,dx,dy,dz)
local we2,wx2,wy2,wz2,e2 = processLineOfSight(sx,sy,sz,dnx,dny,dnz)
local angle = -math.deg(math.atan2(wx1-wx2,wy1-wy2))
sx,sy,sz are source coordinates, dx,dy,dz are destination coordinates and dnx,dny,dnz are coordinates near the destination. If you get dx,dy,dz from screen (let's say pixels are sx,sy), you can get dnx,dny,dnz from the pixel which is right from the first (sx+1,sy).
edit: this is for vertical surfaces. It would need some more work to get vertical angle.