Absolutely. PCIe is backwards compatible, therefore you can most certainly use a PCIe Gen 3 GPU (the Colorful GeForce GTX 1650) in a PCIe Gen 2 slot on your motherboard (the Gigabyte 970-DS3P).
However, the speed of the GPU may be impacted significantly. There's a sort of PCIe link established, when you place a component (in your case a GPU) in a PCIe slot. And that link will operate at the speed of the slowest component. In your case, that is your slot, as the GPU is PCIe Gen 3 and the slot is PCIe Gen 2, which may lead to the GPU being throttled and not reaching its full potentional.
To combat this, I would consider purchasing a completely new motherboard that supports at least PCIe Gen 3 or higher (Gen 4 or even 5).
You can safely put a PCIe Gen 3 GPU in a PCIe Gen 4 as then the slowest component will be your GPU and you will be able to reach the GPU's full potential, as it won't be slowed by the PCIe slot.
My suggestion is getting a motherboard that supports your current CPU and PCIe x16 (x16 is the slot you put your GPU in) Gen 4, as you'll probably upgrade your GPU down the road.
To conclude, yes, you are able to put your new GPU (PCIe Gen 3) in your motherboard (PCIe Gen 2), but it is suggested not to do so. Therefore, my suggestion is to upgrade your motherboard to one that supports PCIe Gen 3 or even 4.