The European Space Agency astrometric Gaia mission, due for a launch in late 2012, will observe a large number of asteroids (>250 000 to V= 20 mag) over five years with an unprecedented positional accuracy (at the submilliarcsecond level). Among them, there will be a subset of near-Earth asteroids (NEAs), all sensitive to the tiny non-gravitational force due to the Yarkovsky effect, hardly detectable with ground based astrometry. Here we investigate the potential of Gaia to detect the Yarkovsky effect. From realistic simulated data on the currently known NEAs observable by Gaia, we performed a variance analysis from the observation residuals on a data model linearized with respect to the initial position and velocity of the asteroid and its semimajor axis drift rate (da/dt)– the main secular effect due to the Yarkovsky effect. The partial derivatives necessary to evaluate the expected accuracy with Gaia observations of (da/dt) are obtained by a numerical integration of the variational equations. We thus give the list of the most promising 64 NEAs for the detection of the Yarkovsky effect by Gaia, with an expected precision on (da/dt) better than 5 × 10−4 au Myr−1 (from underestimated astrometric precision). We also add for each asteroid, the physical parameters to be precisely estimated from complementary ground-based observations (photometric, radar) to accurately model the Yarkovsky effect.