Depends on what your priorities are. The P900 will give you much bigger equivalent focal length (2000 mm vs 210 mm equivalent) at the expense of significantly worse low light performance, worse battery life (P900's display or EVF need to work at all times). The weight would be about the same (P900: 899 g vs D5200: 555 g + 18-140: 490 g). With the P900 you gain 2 fps burst shooting (7 vs 5 fps), but that's questionably useful as P900 only has contrast detect AF and the D5200 has (naturally) phase detect AF with 39 points similar to what was previously found in the upper class D7000.
Yes, you will get decent photos from the P900 if the light is good enough. In bad light the D5200 will be the better choice.