We consider the problem of gray-box identification of dynamic models for mechanical systems. In particular, the problem is approached by means of continuous-time system identification using subspace-based methods based on discretetime input-output data. A method is developed, with the property that the structure of the model resulting from fundamental physical first principles is obtained and the parameter matrices have a clear physical interpretation. The proposed method is subsequently successfully validated in both simulation and using experimental data from a three-axis manipulator. In both cases the identified models exhibit good fit to the input-output data.The results indicate that the proposed method can be useful in the context of model-based control design in, for example, impedance force control for robots and manipulators, but also for modal analysis of mechanical systems.