Cosmic voids in the large-scale structure of the Universe affect the peculiar motions of objects in their vicinity. Although these motions are difficult to observe directly, the clustering pattern of their surrounding tracers in redshift space is influenced in a unique way. This allows to investigate the interplay between densities and velocities around voids, which is solely dictated by the laws of gravity. With the help of $N$-body simulations and derived mock-galaxy catalogs we calculate the average density fluctuations around voids identified with a watershed algorithm in redshift space and compare the results with the expectation from general relativity and the $Lambda$CDM model. We find linear theory to work remarkably well in describing the dynamics of voids. Adopting a Bayesian inference framework, we explore the full posterior of our model parameters and forecast the achievable accuracy on measurements of the growth rate of structure and the geometric distortion through the Alcock-Paczynski effect. Systematic errors in the latter are reduced from $sim15%$ to $sim5%$ when peculiar velocities are taken into account. The relative parameter uncertainties in galaxy surveys with number densities comparable to the SDSS MAIN (CMASS) sample probing a volume of $1h^{-3}{rm Gpc}^3$ yield $sigma_{f/b}left/(f/b)right.sim2%$ ($20%$) and $sigma_{D_AH}/D_AHsim0.2%$ ($2%$), respectively. At this level of precision the linear-theory model becomes systematics dominated, with parameter biases that fall beyond these values. Nevertheless, the presented method is highly model independent; its viability lies in the underlying assumption of statistical isotropy of the Universe.