The two main ones I'm talking about are by Sebastian Bourdon (1640) and Giovan Francesco Barbieri (1625), though I'm sure there were others. If the story hadn't been created yet, I don't see how there could have been artwork depicting it.
The story of Dido's suicide existed 1700 years before Purcell came along. It's in Vergil's Aeneid, book 4. Here's the relevant bit, where she stabs herself with a sword, while making speeches.
The motif of a 'lament', as such, probably owes more to Purcell's famous aria, but one of her speeches in Vergil is a lament too; and it's probably worth observing that the painters you point to are depicting her death, not a lament specifically.
Vergil is the ultimate source for the death narrative, but Dido herself was a traditional character in his time too. In earlier stories she's called Elissa, and she had nothing to do with Aeneas. Here's an answer from last year by me that talks a bit about Vergil's sources; the last two paragraphs touch on Dido/Elissa.
I love this sub. Learning so much every day. Thank you for posting questions and those for answering.