[abridged] We carry out numerical simulations to gauge the Gaia potential for precision astrometry of exoplanets orbiting a sample of known dM stars within 30 pc from the Sun. (1) It will be possible to accurately determine orbits and masses for Jupiter-mass planets with orbital periods in the range 0.2<P<6.0 yr and with an astrometric signal-to-noise ratio > 10. Given present-day estimates of the planet fraction f_p around M dwarfs, 100 giant planets could be found by Gaia around the sample. Comprehensive screening by Gaia of the reservoir of 4x10^5 M dwarfs within 100 pc could result in 2600 detections and as many as 500 accurate orbit determinations. The value of f_p could then be determined with an accuracy of 2%, an improvement by over an order of magnitude with respect to the most precise values available to-date; (2) in the same period range, inclination angles corresponding to quasi-edge-on configurations will be determined with enough precision (a few percent) so that it will be possible to identify intermediate-separation planets which are potentially transiting within the errors. Gaia could alert us of the existence of 10 such systems. More than 250 candidates could be identified assuming solutions compatible with transit configurations within 10% accuracy, although a large fraction of these (85%) could be false positives; (3) for well-sampled orbits, the uncertainties on planetary ephemerides, separation and position angle, will degrade at typical rates of < 1 mas/yr and < 2 deg/yr, respectively; (4) planetary phases will be measured with typical uncertainties of several degrees, resulting (under the assumption of purely scattering atmospheres) in phase-averaged errors on the phase function of 0.05, and expected uncertainties in the determination of the emergent flux of intermediate-separation (0.3<a<2.0 AU) giant planets of 20%. [abridged]