In this paper, we show that the gluing of germs of formal complex spaces is also a formal complex space. Moreover, we study the Betti numbers of the gluing of formal complex spaces and, for instance, we show that the Betti numbers satisfy beta((x,0) )(i)(0) >= ((d)(i)), for all 1 <= i <= d, where (x, 0) is a d-dimensional germ of formal complex space given by a regular and a singular germ of formal complex spaces with the same dimension. In particular, this proves the Buchsbaum-Eisenbud-Horrocks conjecture for certain gluing of germs of formal complex spaces. Some formulas for the Betti numbers of the gluing of germs of formal complex spaces are given in terms of the invariant multiplicities, Euler obstruction, Milnor number, and polar multiplicities. As an application, some upper bounds for the Betti numbers of the gluing of some germs of complete intersection are provided, using recent progress on the Watanabe's conjecture.