The square-well (SW) potential is one of the simplest pair potential models and its phase behavior has been clearly revealed, therefore it has become a benchmark for checking new theories or numerical methods. We introduce the generalized canonical ensemble (GCE) into the isobaric replica exchange Monte Carlo (REMC) algorithm to form a novel isobaric GCE-REMC method, and apply it to the study of vapor-liquid transition of SW particles. It is validated that this method can reproduce the vapor-liquid diagram of SW particles by comparing the estimated vapor-liquid binodals and the critical point with those from the literature. The notable advantage of this method is that the unstable vapor-liquid coexisting states, which cannot be detected using conventional sampling techniques, are accessed with a high sampling efficiency. Besides, the isobaric GCE-REMC method can visit all the possible states, including stable, metastable or unstable states during the phase transition over a wide pressure range, providing an effective pathway to understand complex phase transitions during the nucleation or crystallization process in physical or biological systems.