How to apply depth of field inside specific region?

There is a depth of field function. Maybe you can manipulate the pixel depth to achieve the desired effect. Can’t be much more of help because I don’t use DoF in my project.