Is it necessary to use a dash to indicate a suspension in a figured bass?
No. It is both unnecessary and unusual.
As Albrecht Hügli notes, a dash is used when the bass note changes but the harmony (or perhaps one voice in the harmony) does not. But that's not what's happening here. In this case, an upper voice is moving, while the bass is not.
The dashes may perhaps be intended to underscore that the motion in the upper voice does not represent a change in the harmony, since in both cases the voice is leaping from one chord tone to another. But this notation is not commonly seen in figured bass writing from the baroque period. A suspension is normally indicated by placing the figures for the moving voice in sequence horizontally. In other words, the hyphen appearing between the seven and the six in your example would be absent.