In general relativity, the gyromagnetic ratio for all stationary, axisymmetric, and asymptotically flat Einstein-Maxwell fields is known to be g=2. In this paper, we continue our previous works of examination of this result for rotating charged spacetimes with asymptotic nonflat structure. We first consider two instructive examples of these spacetimes: The spacetime of a Kerr-Newman black hole with a straight cosmic string on its axis of symmetry and the Kerr-Newman Taub-NUT (Newman-Unti-Tamburino) spacetime. We show that for both spacetimes the gyromagnetic ratio g=2 independent of their asymptotic structure. We also extend this result to a general class of metrics which admit separation of variables for the Hamilton-Jacobi and wave equations. We proceed with the study of the gyromagnetic ratio in higher dimensions by considering the general solution for rotating charged black holes in minimal five-dimensional gauged supergravity. We obtain the analytic expressions for two distinct gyromagnetic ratios of these black holes that are associated with their two independent rotation parameters. These expressions reveal the dependence of the gyromagnetic ratio on both the curvature radius of the AdS background and the parameters of the black holes: The mass, electric charge, and two rotation parameters. We explore some special cases of interestmore » and show that when the two rotation parameters are equal to each other and the rotation occurs at the maximum angular velocity, the gyromagnetic ratio g=4 regardless of the value of the electric charge. This agrees precisely with our earlier result obtained for general Kerr-AdS black holes with a test electric charge. We also show that in the Bogomol'nyi-Prasad-Sommerfield (BPS) limit the gyromagnetic ratio for a supersymmetric black hole with equal rotation parameters ranges between 2 and 4.« less