How do I put all the game objects on a certain layer that are within a certain polygon collider into an array/List?

Hello! I have a quick question. So in my game I want there to be doors that shut until all of the enemies have been defeated (akin to Zelda or whatnot). And for simplicity’s sake I wanted to use the polygon colliders that I already have that designate where the camera can go because I’m using cinemachine’s confiner tool. My issue is that I cannot figure out how to make the script that is attached to the polygon2D collider add the enemy game objects into the list. I’ve tried using GameObject.FindObjectsWithTag but it gets all of the game objects within the scene and not just the area that is already predetermined by the polygon collider? I have all of the enemy objects on an Enemy layermask and on two unique tags, so I would like to be able to leverage my foresight with this issue.

Here is my code so far:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyRoom : MonoBehaviour
{
    public DoorManager[] doors;
    public List<GameObject> listOfEnemies = new List<GameObject>();
    public PolygonCollider2D room;
    public LayerMask enemyLayer;
    
    // Start is called before the first frame update
    void Start()
    {
        listOfEnemies.AddRange(GameObject.FindGameObjectsWithTag("Enemy"));
        print(listOfEnemies.Count);
    }

    
    public bool areTheyDead()
    {
        if (listOfEnemies.Count <= 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public void CloseDoors()
    {
        for (int i = 0; i < doors.Length; i++)
        {
            doors*.Close();*

}
}

public void OpenDoors()
{
for (int i = 0; i < doors.Length; i++)
{
doors*.Open();*
}
}

// Update is called once per frame
void Update()
{

//listOfEnemies.AddRange()
}
}
If anyone has some bright ideas, please let me know!

One way could be to use Collider2D.Cast.
Unity - Scripting API: Collider2D.Cast.

Cast result is stored in an array and you can also define ContactFilter2D that supports (among others) filtering by the layerMask.