We derive both BPS and non-BPS first-order flow equations for magnetically charged black strings in five-dimensional N = 2 abelian gauged supergravity, using the Hamilton-Jacobi formalism. This is first done for the coupling to vector multiplets only and U(1) Fayet-Iliopoulos (FI) gauging, and then generalized to the case where also hypermultiplets are present, and abelian symmetries of the quaternionic hyperscalar target space are gauged. We then use these results to derive the attractor equations for near-horizon geometries of extremal black strings, and solve them explicitely for the case where the constants appearing in the Chern-Simons term of the supergravity action satisfy an adjoint identity. This allows to compute in generality the central charge of the two-dimensional conformal field theory that describes the black strings in the infrared, in terms of the magnetic charges, the CY intersection numbers and the FI constants. Finally, we extend the r-map to gauged supergravity and use it to relate our flow equations to those in four dimensions.