Selecting in Photoshop

  1. Open your render.
  2. Place the ID PNG as a layer above it.
  3. Magic wand, with Tolerance 0, Anti-alias off, Contiguous off.
  4. Click a colour. Contiguous-off is what makes this select every wall in the frame rather than only the one you clicked.
  5. Hide the ID layer. The selection now applies to the render underneath.

Use Select ▸ Modify ▸ Expand by 1px if you are compositing over an anti-aliased render and want the selection to reach under the render's own soft edge.