Like Vince said, the only burst option you need to watch out for is dash attack. Otherwise, you can (wisely) use arrows to pressure the DK into approaching. Dark Pit has a very good walk speed, you can utilitze this to walk backwards out of range of his attacks and whiff-punish him with nair, fair, bair, etc.
He should be coming to you.
As far as punishing the upB, don't be afraid to hang around offstage while he mixes up his recovery timing. Make use of your multiple jumps. Stay out of his range ... DK's verticle burst is about limited to double jump -> up air. You can react to his upB with a fast fall down air, and as long as you trust in your character's range, you can spike him without getting touched.
Alternatively, you can try guarding the ledge with a sideB of your own. DK will be looking to upB as soon as you and he are horizontally level, so he can abuse his intangibility and long-range upB and beat your option, but electroshock arm will rip right through the upB and an score some early kills.
You have to recognize when DK is coming in for bair spam. If he runs in, turns around, jumps and full hop -> back air, then he's probably going to do another one as he comes down (this is a popular walling strategy with DK). When you see the first bair, get ready to sideB the next one. Alternatively, like I said earlier, if you have some space to work with, walk out of his range and swat him backwards with forward tilt.
Heavies in this game tend to get overconfident with their neutral options, which work best when the opponent picks lots of defensive options. To take the edge in the matchup, you have to call out these unsafe options with proper punishes: a conventional shield -> grab approach may not work because of the power and speed of the attack, but practically no move is safe on whiff, and a sword character like Dark Pit has great options to out-space and punish these moves. That should be your game plan whenever you see DK turn around and throw out bairs like mad.