Context. Both, C/2001 Q4 and C/2002 T7, are widely regarded in the literature as dynamically new comets that are visiting our planetary system for the first time from the Oort Cloud. Aims. We study the past dynamical evolution of these two bright comets that both have an original semimajor axis inside the so-called Oort spike (i.e. with 1/a ori < 10 −4 AU −1 ). Methods. For each comet, we constructed a dedicated grid of independent, starting, osculating swarms of 5000 orbits based on different subsets of positional data and different dependences of the non-gravitational acceleration on the heliocentric distance. We then followed numerically each swarm of non-gravitational orbits one orbital revolution into the past, taking into account both planetary and Galactic perturbations and checking for all known stellar perturbers. This method allows us to obtain the orbital elements and their uncertainties at the previous perihelion passage. Results. We find that the dedicated g(r)-like function seems to be more adequate for describing the non-gravitational effects than the standard g(r)-function in the motion of both comets, but we are able to estimate only two parameters: the scale distance r 0 , and the exponent m. We show, however, that the greatest change in the previous perihelion value relative to that obtained in the standard approach results from the type of data subset used for non-gravitational orbit determination. The form of the dependence of nongravitational acceleration on heliocentric distance is of secondary importance for both investigated comets in this context. We find that only comet C/2002 T7 passed far beyond the planetary system during its previous perihelion passage and that C/2001 Q4 was probably well inside the Saturn orbit at a previous perihelion. Conclusions. We argue that for these comets (which have long sequences of positional data), the safest method for the previous perihelion determination is to exclude data within time intervals where some local outbursts were reported. We recommend that the non-gravitational models based on data taken at larger perihelion distance are more appropriate for estimating the distance of previous perihelion passage of C/2001 Q4 and those based on a pre-perihelion data set for previous perihelion estimation of C/2002 T7. These models suggest that C/2001 Q4 passed its previous perihelion closer than 6-7 AU from the Sun, so is dynamically old, whereas C/2002 T7 at a distance larger than 400 AU, is a dynamically new comet since it overcame the Jupiter-Saturn barrier.