An ejectment is an eviction action brought in Civil Court or Supreme Court instead of Housing Court in NYC or City/County Courts in NYS. This is a regular civil lawsuit: long, drawn-out. Usually, the LL starts an ejectment action because he is forbidden by law from using the faster summary proceeding in the other courts. The most common reason in NYC is that the apt is illegal, often in an illegal-three or commercial building, i.e., building lacks Certificate of Occupancy, Multiple Dwelling Registration, etc.
The tenant has all of the same defenses and counterclaims as in a summary proceeding, plus others.