They both learn Trick Room. They have the same type.
Necrozma D-W has a lower Speed, making it better in Trick Room, and higher Def, SpD and SpA. Its ability decreases super effective hits' damage no matter what is HP is at.
Lunala's only advantages are a slightly higher HP, knowing a Ghost type attack, in Moongeist Beam, and access to an ability that decreases damage a little more, but for only the first hit.