I would do this with only one collider and then analyze the contact points to decide who gets hurt.

    private void OnCollisionEnter2D(Collision2D collision) {
        if (collision.gameObject == GameObject.FindWithTag("Player"))
           var contact = collision.GetContact(0);
           Vector2 collisonPoint = contact.point;

Now you have one of the points in world space where the colliders of player and enemy touched. When its y-component is on the upper edge of the enemy collider, that means the player hit form above. When it's further down, the player hit from the side or from below.