Especially w/ handguns, the weapon will torque away from the restraining points. There's two major ones to consider, although I can add more.

First, since your wrist is below the barrel axis in a normal firing position, the weapon will rotate upwards. Held "sideways" (gangsta-style as you call it) it will rotate in the horizontal plane.

Second factor to consider that will influence muzzle rise is that your feet are the restraint or pivot poit for your entire body. As the recoil force is almost invariably well off center of your feet, your entire body will tend to rock backwards, thus generating muzzle climb regardless of how the weapon is held.

Another factor that occurs when shooting one handed is that the weapon will tend to rotate to the left (assuming a RH shooter) as the mass of the hand itself acts as a restraint that is off axis to the bore centerline. Minor grip changes, however can negate a good deal of this influence.

As noted above, rifles have their own considerations, but the idea is the same. Torque, moments, inertia, it can get all "mathy" but the concept is pretty simple. Just look for constraints, and see how far off the centerline of the bore of the weapon they are.