Just a pet peeve of mine:
No, it's never stated in TNG, or TOS, DS9 or VOY or the movies for that matter, that warp drive must precede first contact. Instead, many episodes suggest that once a species acquires warp drive, or is about to, first contact becomes inevitable, and there's no advantage to the UFP holding back when the intrepid warp explorers will run into somebody else anyway.
The first episode ever to actually associate warp drive and first contact with each other in direct dialogue is, amazingly enough, DSC "Si Vis Pacem, Para Bellum", where we finally hear this:
Of course, Starfleet will readily reveal itself to sentient beings who have already been contacted by other space aliens, even if the invention of warp drive is still far in their future. Indeed, Kirk often contacted folks who weren't struggling with inventing the steam engine yet. And indeed Burnham here contacts the locals as fait accomplii.
But TNG has a role to play here, too. In the suddenly awfully relevant "Measure of a Man", he speaks of making contact with the strange alien civilization known as Data! Said civilization probably knows how to build a warp engine, but as far as we can tell, Data has built none...
Timo Saloniemi