Recent observations of resolved cold debris discs at tens of au have revealed that gaps could be a common feature in these Kuiper-belt analogues. Such gaps could be evidence for the presence of planets within the gaps or closer in near the edges of the disc. We present SPHERE observations of HD 92945 and HD 107146, two systems with detected gaps. We constrained the mass of possible companions responsible for the gap to 1-2 MJup for planets located inside the gap and to less than 5 MJup for separations down to 20 au from the host star. These limits allow us to exclude some of the possible configurations of the planetary systems proposed to explain the shape of the discs around these two stars. In order to put tighter limits on the mass at very short separations from the star, where direct-imaging data are less effective, we also combined our data with astrometric measurements from Hipparcos and Gaia and radial-velocity measurements. We were able to limit the separation and the mass of the companion potentially responsible for the proper-motion anomaly of HD 107146 to values of 2-7 au and 2-5 MJup, respectively.