well not sure if this applys but I had taken my tailgate off to shave off the decals and when i put it back on it would not shut all the way, what happened was the tailgate rope ( line/whatever ) was attached to the wrong stud and was not allowing it to fully close. the rest of the line was getting in the way, i would see if that works, but only if you have taken the tailgate off before.
when it gets really cold up here the rubber bump stops harden up enough that my tailgate won't latch shut. the i depend on the topper window to hold it up. you can shave up the stops some to get it to close but may experience rattling of the tailgate.
I don't know how the Dakota gates are hinged, but it looks like either the right hinge has dropped or both have gotten a little bent. So you'll need to either reset a bolted hinge or bend the hinges back into place.
You'll probably have to take the tailgate off and adjust the brackets at the bottom where it hinges. It'll talke some time to get it right. And, ya, those rubber stops do get in the way sometimes. I just adjusted my tailgate and had to trim the stops a little