We report results of joint experimental and theoretical studies on magnetoelectric (ME) compounds Co 4 Nb 2 O 9 and Co 4 Ta 2 O 9 . On the experimental side, we present results of the magnetization and dielectric permittivity measurements in the magnetic field. On the theoretical side, we construct the low-energy Hubbard-type model for the magnetically active Co3d bands in the Wannier basis, using the input of first-principles electronic structure calculations, solve this model in the mean-field Hartree-Fock approximation, and evaluate the electric polarization in terms of the Berry phase theory. Both experimental and theoretical results suggest that Co 4 Ta 2 O 9 is magnetically softer than Co 4 Nb 2 O 9 . Therefore, it is reasonable to expect that the antiferromagnetic structure of Co 4 Ta 2 O 9 can be easier deformed by the external magnetic field, yielding larger polarization. This trend is indeed reproduced by our theoretical calculations, but does not seem to be consistent with the experimental behavior of the polarization and dielectric permittivity. Thus, we suggest that there should be a hidden mechanism controlling the ME coupling in these compounds, probably related to the magnetic striction or a spontaneous change of the magnetic structure, which breaks the inversion symmetry. Furthermore, we argue that unlike in other ME systems (e.g. Cr 2 O 3 ), in Co 4 Nb 2 O 9 and Co 4 Ta 2 O 9 there are two crystallographic sublattices, which contribute to the ME effect. These contributions are found to be of the opposite sign and tend to compensate each other. The latter mechanism can be also used to control and reverse the electric polarization in these compounds.