In space gravitational wave detection missions, the gravity and its gradients produced by the spacecraft on the two Test Masses (TMs) are commonly referred to as the Self-Gravity(SG). It is an important source of TM disturbances in gravitational wave detection and other drag-free space missions and will affect the TM acceleration noise in many ways. The SG can be reduced by adding Balance Masses (BMs). But for typical space gravitational wave detectors, in which the sensitive axes of the two TMs are at an angle of 60°, the couplings of different SG components of two TMs make the gravity compensation process complicated in practice, which is normally an iterative process. This paper analyses the correspondence between the SG components of the two TMs and the spherical harmonics of different orders, and proposes a compensation method based on spherical multipole expansion. This method allows independent design of the BMs for most of the main SG components, without couplings and iterations. To verify this method, a self-gravity compensation simulation is carried out by using a demonstrating spacecraft structural model for TianQin gravitational wave detection mission. Three sets of BMs are designed on the outer surface of the inertial sensor vacuum chamber, to compensate for the two linear accelerations and one linear gradient that exceed the requirements. The results show that the SG components after compensation are two orders of magnitude lower than the initial level, and all the components meet the preliminary requirements of TianQin mission. This study could provide reference for the engineering design and development of the spacecraft and inertial sensor payload for space gravitational wave detection missions.