In my house, I have 2 breaker boxes. In the basement there is a 200-amp main box, with the ground and neutral bars bonded. Feeding the main floor, there is a 100-amp sub-panel (branched off the main box) that has a separate ground and neutral bar.
I am currently finishing the basement, and am installing the lighting. For the stairway going downstairs, I have an existing 3-way switch that controls the stairway lights. This circuit is fed from the 100-amp sub-panel upstairs (area in dashed box in picture). I now want to add a lighting circuit for the main room in the basement. This involves switching out the 1-gang box at the bottom of the stairs for a 2-gang, adding power in from the existing 200-amp service in the basement, and running my wire off to the lights.
My question is: since I am mixing not only circuits, but one circuit from the main panel (the downstairs lights), with a circuit from the sub-panel (the stairway lighting), what do I do with the ground wires? Do I tie them together, or isolate them? Unfortunately, the box at the top of the stairs is part of a 2-gang box that feeds upstairs lighting as well, so even if I switch the stairway light circuit to be fed from the 200-amp panel at the bottom of the stairs, I have the same problem in the upstairs 2-gang box. (For code purposes/passing my inspection, the state I am in has adopted the 2014 NEC)