When I was researching here and elsewhere earlier this year, my limited understanding is that ideally the gauge set has to come from a truck with the same engine and year to ensure maximum compatibility, but at a minimum, if it's within a year or so of the truck it's going in, and comes from a truck with at least the same kind of engine and number of cylinders, it should work mostly fine regardless of engine displacement (about the only thing is that the redline is in a different spot depending on what size V6 or V8 the truck has).
As for whether a gauge set from a diesel would work in a gas truck, I'd think that, aside from where the tach signal comes from and a few minor cosmetic differences, the features that are common among the gauge sets in all models (speedometer, voltage, temp and fuel, and most indicator lights) would work fine regardless of what truck they're put in, provided it's close to the same year so the wiring harness(es) and mounting points match.
c
As for whether a gauge set from a diesel would work in a gas truck, I'd think that, aside from where the tach signal comes from and a few minor cosmetic differences, the features that are common among the gauge sets in all models (speedometer, voltage, temp and fuel, and most indicator lights) would work fine regardless of what truck they're put in, provided it's close to the same year so the wiring harness(es) and mounting points match.
c