We determine geodesics and flat totally geodesic subalgebras in higher-step nilpotent metric Lie algebras of dimension 5. It is surprising that in the nonfiliform metric Lie algebras with 1-dimensional center, the geodesic vectors and flat totally geodesic subalgebras are independent of the choice of the inner product.