These devices appear to be very close in specification. You should be ok doing the replacement -- but why are you doing so?
This message was posted on behalf of Intel Corporation
Correct, as per the specs of HMT451S6BFR8A-PB it should work fine with both NUCs.
Compatible RAM type: DDR3L-1333/1600 1.35V SO-DIMM
Memory that is within those specs, should work fine with your Intel® NUC Kit NUC5PPYH and Intel® NUC Kit NUC5CPYH
Both units compared: http://ark.intel.com/compare/87740,85254
If any further questions are present, feel free to let us know.