Yes, it's alright in as much as sound will get from the DJ mixer to the speakers.
However, you may well find that you hear audible hums or buzzes, and if so, that will be because there is a 'ground-loop' between the DJ mixer and speakers. This is a very common problem when using unbalanced connections between mains-powered equipment. Much better to use balanced connections where possible... but it's not possible with your DJ mixer, obviously.
So, if you can hear unwanted hums or buzzes, the first thing is to make sure that the mains plugs from the mixer, turntables and speakers are all plugged into the same mains plug-board. Doing that minimises the size of the ground-loop, and it may well cure the problem or reduce it to acceptable levels.
If you still have audible hum, then you need to break the ground-loop between the DJ mixer and speakers. There are several ways to do that, but the easiest is to purchase a line isolation box. I usually recommend the ART DTI which costs about £40 but there are a number of similar alternatives. I like the DTI because of the variety of connection formats which makes it a very versatile box!
https://www.soundonsound.com/reviews/art-dti
The transformers inside the box separate the grounds of the input and output devices, and also convert between unbalanced and balanced signal formats.
So, plug the DJ mixer to the DTI box using ordinary short phono-phono cables, and then use balanced cables to connect the DTI outputs to the speakers -- either TRS-TRS or XLR-XLR, or some other suitable combination.
Place the DTI box near the DJ mixer, but be aware that its transformers can pick up external magnetic fields, so keep it away from any mains power transformers in the equipment.
Hope that helps.
H