Problem with scripts communicating between each other

I am using the GetComponent method to tell if an enemy is dead, but it comes up with the error ‘enemyHasDied’ is not a member of ‘UnityEngine.Component’. Here is my code.

function Kill(){
var newSpawn = GameObject.FindWithTag("Player").GetComponent(EnemySpawn);
newSpawn.enemyHasDied();
Destroy(this.gameObject, 2);
}

enemyHasDied is a function in the EnemySpawn script so I don’t know what’s going on.

use a cast, for JS it’s “as EnemySpawn” or “: EnemySpawn”

where do I add that into my script?