Let $v_1,v_2 \in\mathbb{R}^n$ be linearly independent normal vectors, i.e. $\|v_1\|=\|v_2\|=1$ and $\operatorname{dim}\operatorname{Span}(v_1,v_2)=2$.
Let $\{r_3, r_4,\dots, r_n\}$ be an orthonormal basis for the orthogonal complement $\operatorname{Span}(v_1,v_2)^{\perp}$ of the plane spanned by $v_1$ and $v_2$.
First we find an orthonormal basis for $\operatorname{Span}(v_1,v_2)$, let it be $\{w_1,w_2 \}$. One can simply use Gram–Schmidt process to obtain this basis as
$$
w_1 = v_1,\quad
w_2 = \frac{\Big(v_2-(v_2^{\rm T}w_1)w_1\Big)}{\|v_2-(v_2^{\rm T}w_1)w_1\|} \;.
$$
Then the desired minimal rotation matrix $R$ can be found as
$$
R = \underbrace{\begin{bmatrix} \rule[-1ex]{0.5pt}{6.6ex} & \rule[-1ex]{0.5pt}{6.5ex} & \rule[-1ex]{0.5pt}{6.6ex} & & \rule[-1ex]{0.5pt}{6.6ex} \\
w_1 & w_2 & r_3 & \dots & r_n \\ \rule[-1ex]{0.5pt}{6.6ex} & \rule[-1ex]{0.5pt}{6.6ex} & \rule[-1ex]{0.5pt}{6.5ex} & & \rule[-1ex]{0.5pt}{6.6ex}\end{bmatrix}}_{\Pi}
\underbrace{\begin{bmatrix} \cos(\theta) & -\sin(\theta) & & \\ \sin(\theta) & \phantom{-}\cos(\theta) & & \\ & & 1 & \\ & & & \ddots & \\ &
& & & 1\end{bmatrix}}_{S}
\underbrace{\begin{bmatrix} \rule[-1ex]{0.5pt}{6.6ex} & \rule[-1ex]{0.5pt}{6.5ex} & \rule[-1ex]{0.5pt}{6.6ex} & & \rule[-1ex]{0.5pt}{6.6ex} \\
w_1 & w_2 & r_3 & \dots & r_n \\ \rule[-1ex]{0.5pt}{6.6ex} & \rule[-1ex]{0.5pt}{6.6ex} & \rule[-1ex]{0.5pt}{6.5ex} & & \rule[-1ex]{0.5pt}{6.6ex}\end{bmatrix}^{\rm T}}_{\Pi^{\rm T}},
$$
where $\theta=\arccos(v_1^{\rm T}v_2)$ if $\{w_1,w_2\}$ were obtatined with Gram-Schmidt process, but in general $\theta=\pm\arccos(v_1^{\rm T}v_2)$. The sign is "$+$" if the orientation of $\{w_1,w_2\}$ is the same as the orientation of $\{v_1,v_2\}$, and the sign is "$-$" otherwise. Note that Gram-Schmidt process preserves orientation and gives us a "$+$".
Note that $\Pi \in O(n)$ and $S \in SO(n)$ and thus $$R^{}=\Pi^{} S^{} \Pi^{\rm T} = \Pi^{} S^{} \Pi^{-1} \in S^{}O^{}(n)$$ is a rotation.
Let $\{e_i\}_{i=1}^{n}$ denote a standard basis in $\mathbb{R}^n$. One can see that
$$
R^{}r_i = \Pi^{} S^{} \Pi^{\rm T} r_i = \Pi^{} S^{} e_i = \Pi^{} e_i = r_i ,
$$
which means that $R$ acts as an identity map on $\operatorname{Span}(v_1,v_2)^{\perp}$.
Both $v_1$, $v_2$ are sent by $\Pi ^{\rm T}$ to $\operatorname{Span}(e_1,e_2)$, then rotated by $S$ through an angle $\theta$ and then sent back by $\Pi$. The fact that $\Pi$ is an orthogonal matrix guarantees that the angle between $\Pi ^{\rm T}v_1$ and $\Pi ^{\rm T}v_2$ is the same as the angle between $v_1$ and $v_2$ and we have
$$
S^{}\Pi ^{\rm T}v_1=\Pi ^{\rm T}v_2
$$
$$
v_2=\Pi^{}S^{}\Pi ^{\rm T}v_1
$$
$$
v_2=Rv_1
$$