On a Toyota/Denso sensor the blue wire is signal, and the white wire (if present) is an isolated ground. The pair of black wires on a four wire sensor are for the heater.
Bosch and Bosch-licensed sensors use a pair of white wires for the heater power, and the black wire is for the sensor output. A gray wire, if present, is for the isolated ground.
All oxygen sensor use the same zirconia sensor element, and output the same signal. The difference is solely how they are wired.
The "isolated ground" is a separate reference wire for the sensor. Just like with an audio signal, it avoids electrical noise that might confuse the computer. An exhaust system often doesn't provide a good ground because of insulting gaskets and rusty fasteners. And with certain materials there is a voltage generated with a temperature difference.
If your system was designed with an isolated sensor ground, you should really replace it with a sensor that has a isolated ground. It will *probably* work just grounding that "extra" wire, but you can't be certain that it is working properly or optimally.
You can test a sensor with propane torch, but it will only generate a signal with the flame applied. As soon as the flame is removed the output voltage will drop to zero. The test is to get the sensor hot (it won't respond while cold) and then rapidly move the flame cone over the sensor. As the different sections of the flame cone move over the sensor, the lowest oxygen concentrations will generate the highest voltage. A good sensor will respond quickly, while a degraded sensor will take a second or two to change output.