[step:Represent the polar cone by equality and active inequality gradients]
Define the polar cone $K^\circ\subset\mathbb{R}^q$ by
\begin{align*}
K^\circ:=\{v\in\mathbb{R}^q : v\cdot d\leq 0 \text{ for every } d\in K\}.
\end{align*}
From the previous step,
\begin{align*}
-\nabla F(z^*)\in K^\circ.
\end{align*}
Let $DG_{I,z^*}:\mathbb{R}^q\to\mathbb{R}^{I}$ be the linear map defined by
\begin{align*}
DG_{I,z^*}d:=(DG_{i,z^*}d)_{i\in I}.
\end{align*}
We write vectors $\mu_I\in\mathbb{R}^{I}$ with coordinates indexed by $i\in I$, and $DG_{I,z^*}^{\top}:\mathbb{R}^{I}\to\mathbb{R}^q$ denotes the transpose map.
We use the following finite-dimensional Farkas polar form. If $E:X\to Y$ and $H:X\to\mathbb{R}^m$ are linear maps between finite-dimensional Euclidean spaces, and
\begin{align*}
C:=\{x\in X:E x=0 \text{ and } (Hx)_r\leq 0 \text{ for every } r\in\{1,\dots,m\}\},
\end{align*}
then
\begin{align*}
C^\circ=\{E^\top \lambda+H^\top \nu : \lambda\in Y,\ \nu\in[0,\infty)^m\}.
\end{align*}
This is the separating-hyperplane form of Farkas' lemma for a homogeneous system of linear equalities and inequalities. Applying it with $X=\mathbb{R}^q$, $Y=\mathbb{R}^a$, $E=DA_{z^*}$, $m=|I|$, and $H=DG_{I,z^*}$ gives
\begin{align*}
K^\circ=\{DA_{z^*}^{\top}\lambda+DG_{I,z^*}^{\top}\mu_I : \lambda\in\mathbb{R}^a,\ \mu_I\in\mathbb{R}^{I},\ \mu_i\geq 0 \text{ for every } i\in I\}.
\end{align*}
The sign convention matches the definition of $K^\circ$: if $v=DA_{z^*}^{\top}\lambda+DG_{I,z^*}^{\top}\mu_I$ with $\mu_i\geq 0$ for every $i\in I$ and $d\in K$, then
\begin{align*}
v\cdot d=\lambda\cdot DA_{z^*}d+\sum_{i\in I}\mu_iDG_{i,z^*}d\leq 0.
\end{align*}
Applying this representation to $-\nabla F(z^*)\in K^\circ$, there exist $\lambda\in\mathbb{R}^a$ and $\mu_I\in\mathbb{R}^{I}$ with $\mu_i\geq 0$ for every $i\in I$ such that
\begin{align*}
-\nabla F(z^*)=DA_{z^*}^{\top}\lambda+DG_{I,z^*}^{\top}\mu_I.
\end{align*}
Equivalently,
\begin{align*}
\nabla F(z^*)+DA_{z^*}^{\top}\lambda+DG_{I,z^*}^{\top}\mu_I=0.
\end{align*}
[/step]