Depends on the design of the systems.
If the switches are wired as individual completely-separately-wired momentary switches on both, then you just wire up the appropriate switch to the appropriate wire pair on the other unit.
If the switches use a common point, then as long as that's the same on boht (both ground, or both 5v, etc) then again it's as simple as wiring the apropriate points together.
If they are wired differently, you'd have to make cuts on the PCB to isolate the switches as needed and rewire from there.
If there are any electronics in there beyond the switches, then depending on what they are and how they alter the operation, you may have to alter the replacement unit to match, etc.
So....you'd either have to open each unit up, or do electrical continuity testing with each button in each state on both units to find out what they actually do, and which wires are used for each switch or function.