You can't directly write to the stencil buffer using a pixel shader like you can with depth using SV_Depth. The only way to write to the stencil buffer is to do it indirectly using a depth/stencil state. You can read the stencil data if you want, but that's not very helpful in your case. Note that to read stencil you have to create a separate shader resource view using DXGI_FORMAT_X24_TYPELESS_G8_UINT, and bind it as a separate texture. The stencil data will then be in the green channel of the texture when you sample it in the shader.
Do you actually use multiple stencil buffer values? It would be possible to "copy" the stencil value by doing 1 extra pass per stencil bit. So if you were only using 1 bit, you could fill the stencil using 1 extra pass after the depth fill pass. If you were using all possible values, then you would need 8 extra passes.