We prove the integrability of magnetic geodesic flows of \(SO(n)\) -invariant Riemannian metrics on the rank two Stefel variety \(V_{n,2}\) with respect to the magnetic field \(\eta d\alpha\) , where \(\alpha\) is the standard contact form on \(V_{n,2}\) and \(\eta\) is a real parameter.Also, we prove the integrability of magnetic sub-Riemannian geodesic flows for \(SO(n)\) -invariant sub-Riemannian structures on \(V_{n,2}\) . All statements in the limit \(\eta=0\) imply the integrability of the problems without the influence of the magnetic field. We also consider integrable pendulum-type natural mechanical systems with the kinetic energy defined by \(SO(n)\times SO(2)\) -invariant Riemannian metrics. For \(n=3\) , using the isomorphism \(V_{3,2}\cong SO(3)\) , the obtained integrable magnetic models reduce tointegrable cases of the motion of a heavy rigid body with a gyrostat around a fixed point:the Zhukovskiy – Volterra gyrostat, the Lagrange top with a gyrostat, and the Kowalevskitop with a gyrostat. As a by-product we obtain the Lax presentations for the Lagrangegyrostat and the Kowalevski gyrostat in the fixed reference frame (dual Lax representations).