Several properties that hold in nonempty finite semigroups also hold in nonempty compact semigroups. Furthermore, many of these properties can be formulated by a first order sentence. For instance, the existence of a minimal element for the preorder $\leqslant_{\mathcal J}$ can be translated as follows $$ \exists x\ \forall y\ \exists a\ \exists b\quad x = ayb $$ Similarly, the fact that the Green relations $\mathcal{D}$ and $\mathcal{J}$ coincide can be expressed by a first order formula, etc.
Now, I am looking for a first order sentence satisfied in every nonempty finite semigroup but not in every nonempty compact semigroup. I would prefer a sentence sitting low in the $\Sigma_n$ or $\Pi_n$ hierarchy, that is, a sentence with a small number of quantifier alternations.
Edit. A topological semigroup is a semigroup equipped with an Hausdorff topology for which the map $(x, y) \to xy\ $ is continuous. A compact semigroup is a topological semigroup which is compact as a topological space.
Here a possible answer: we can express "there is an element which is not the unity and which is a $\mathcal{J}$-maximal element (if we remove the unity)". I propose the following formula, where the Green relations could be thought as first-order formulae: $$∃x (x\neq 1) \land ∀y (y\neq 1 \land x\leq_{\mathcal{J}} y) \to x\mathop{\mathcal{J}} y $$ Since we are in semigroups (and not monoids) the formula $x\neq 1$ is actually a macro for $$\exists z (zx\neq z)\lor (xz\neq z)$$ I believe that this is true in every nonempty finite semigroup except the trivial one. This can be easily fixed with a simple disjunction with the formula: $$\forall x (x=1)$$
However the semigroup $[0,1]$ is a compact semigroup and does not satisfy this first-order formula. Indeed, the $\mathcal{J}$-order on [0,1] match with the classical order on real numbers. By removing the unity we obtain the interval [0,1[ that does not have a maximal element.