I assume you have a model without battery.
In these models brake light circuit has it's own coil to power it and the output is splitted in the junction box to the brake light and brake switch. When brake is not pressed, the original switch is on and output of the coil is grounded. When brake is pushed, contact opens and coil output has to go through the brake light bulb to ground.
Now you have the same situation but with inversely working switch and only one coil circuit to power all your lights. When you press the pedal, light circuit goes to ground and lights go out.
Now you have have to take off the blue wire of brake light from the junction box and
a) hunt down where the black wire from the pedal switch joins the ground circuit of the harness, snip it off and join it to the blue wire headed to the brake light
b) take the black wire off the pedal switch and run a new wire from there to the brake light blue wire.
With regulated electric system there is no need to run the brake light wire through the junction box. You should be able to pull it out of the harness between frame and junction box. After it is inside the frame, it can be joined with a wire from the brake light switch there.