For these borders I would do the strait lines with the pencil tool set at 2 px then just shift + left click and drag. This makes sure that your lines are perfectly strait and that aligning panel borders are perfectly parallel to each other. Then for the diagonal lines I would use the line tool set at 2px and click and drag around a pixel or so in on the inside of each border; making sure to extend the line when panels align. Such as panels 1, 2, & 3 or panels 4 & 5. Then right click > fill with black and delete the lines after the fill. afterwards use the magic wand and select every white part outside of the borders with right click > add to selection and fill with white. Then I do ctrl+d to deselect the outside of the borders. Now this will also cover the SFX overlapping the panels with border and white where applicable. This is easy to fix, just erase the white and border over the SFX with the erase tool (I usually set the optacity of my borders layer at 50 or so while I'm doing this then set it back to 100 once I'm done). As for the borders linking together, I just use the pencil tool set to 3px and shift + left click over the strait ones; being careful to not go over the actual borders, only the connecting piece. for the diagonal borders I then I use the brush tool to both cover the extra border piece with white, and to touch up the corners of the panels in order to either lighten, darken, or fade the pixels so the borders look both sharp and don't have off pixels at the corners.
This may seem like a long process, but after you're used to it doing borders will only take a few minutes at most.