Let us parametrize $M_5(\mathbb R)$ by 10 parameters $(a_1, \dots a_5, b_1, \dots, b_5)$ in following way \begin{align} \tag{$\star$} A = \begin{pmatrix} 0 & -a_1 & 0 & 0 & -b_1 \\ 1 & -a_2 & 0 & 0 & -b_2 \\ 0 & -a_3 & 0 & 0 & -b_3 \\ 0 & -a_4 & 1 & 0 & -b_4 \\ 0 & -a_5 & 0 &1 & -b_5 \end{pmatrix}. \end{align} Let us define a set $\mathcal E$ \begin{align*} \mathcal E = \{A \in (\star): \max_i \text{Re}(\lambda_i(A)) = 0\}, \end{align*} i.e., matrices parametrized as $\star$ having the largest real part of all eigenvalues is $0$. Let \begin{align*} \mathcal F = \{A \in \mathcal E: A \text{ has distinct eigenvalues}\}. \end{align*} I am wondering whether $\mathcal F$ is dense in $\mathcal E$.
See Is $\{A \in E: A \text{ has distinct eigenvalues}\}$ dense in $E = \{A \in M_n(\mathbb R): \max_i \text{Re}(\lambda_i(A))=0\}$? for discussions for matrices with no particular structure assumed.
The problem seems to be difficult.
$(\star)$ is an affine space of dimension $10$.
Let $A=[a_{i,j}]\in\mathcal{E}$ and $spectrum(A)=(\lambda_i)$. If we move a little $A$ through $\mathcal{E}$ to $A'$ with $spectrum(A')=(\lambda'_i)$, then, with probability $1$, the eigenvalues of $A'$ are distinct and when $Re(\lambda_i)<0$, $Re(\lambda'_i)$ too. However, when $Re(\lambda_i)=0$, we cannot conclude about the signum of $Re(\lambda'_i)$.
I think that it is equivalent to choose for $\mathcal{F}$
$\{C=[c_{i,j}]\in\mathcal{E};\text{its eigenvalues are distinct and have negative real part}\}$
Then the elements of $\mathcal{F}$ are stable and satisfy the inequalities $(*)$ of Routh-Hurwitz; cf. chapter "Using matrices" in
https://en.wikipedia.org/wiki/Routh%E2%80%93Hurwitz_stability_criterion
$(*)$ is in the form $P_k((c_{i,j})_{i,j})>0,k=1,\cdots,r$ where the $P_k$'s are polynomial.
In general $A$ is not stable (but almost) and satisfy relations in the form $Q_1=0,\cdots,Q_s=0,Q_{s+1}>0,\cdots,Q_r>0$ where the $(Q_i)$'s are polynomials in the $(a_i,b_j)$'s. Clearly, $A'$ satisfy the conditions $Q_{s+1}>0,\cdots,Q_r>0$.
But what about the signum of $Q_1,\cdots,Q_s$ ? It is reasonable to think that $A'$ satisfies, with probabiity $1$, $Q_1\not= 0,\cdots,Q_s\not= 0$. However, can we choose small variations of our $10$ parameters so that all the $(Q_i)_{i\leq s}$ become $>0$ ?
A bad new; the above polynomial $(Q_i)$ are very complicated.