For fish, swimming in group may be favorable to individuals. Several works reported that in a fish school, individuals sense and adjust their relative position to prevent collisions and maintain the group formation. Also, from a hydrodynamic perspective, relative-position and kinematic synchronisation between adjacent fish may considerably influence their swimming performance. Fish may sense the relative-position and tail-beat phase difference with their neighbors using both vision and the lateral-line system, however, when swimming in dark or turbid environments, visual information may become unavailable. To understand how lateral-line sensing can enable fish to judge the relative-position and phase-difference with their neighbors, in this study, based on a verified three-dimensional computational fluid dynamics approach, we simulated two fish swimming adjacently with various configurations. The lateral-line signal was obtained by sampling the surface hydrodynamic stress. The sensed signal was processed by Fast Fourier Transform (FFT), which is robust to turbulence and environmental flow. By examining the lateral-line pressure and shear-stress signals in the frequency domain, various states of the neighboring fish were parametrically identified. Our results reveal that the FFT-processed lateral-line signals in one fish may potentially reflect the relative-position, phase-differences, and the tail-beat frequency of its neighbor. Our results shed light on the fluid dynamical aspects of the lateral-line sensing mechanism used by fish. Furthermore, the presented approach based on FFT is especially suitable for applications in bioinspired swimming robotics. We provide suggestions for the design of artificial systems consisting of multiple stress sensors for robotic fish to improve their performance in collective operation.