There's no physical difference between 98 and 99 tailgate so that's a staight swap. Only deal breaker is the actual tailgate wiring harness white connector inside the headliner being different in size, so it won't plug in. Also the modules on both years inside the tailgate are different.
If you can trace the wirings that controls the tailgate devices, then it can be done.