The data pin-outs are the same, assuming a reasonably “new” 5.25” drive, not an early ‘80s model.
It was a common upgrade to replace the second 5.25” drive on an older machine with a 3.5” one, so you could have a choice of format depending on your needs. They were interchangeable.
You might have an issue with the power though. I don’t remember seeing a 5.25” drive using the compact power connector pictured there. There might be, and I just don’t remember. There was another older connector type that was wider, with four tubular thick pins in a line. I’m learning that it is commonly referred to as “Molex” but that’s a company name. Power supplies typically provided both sets for choice of device. You will probably need an adapter cable for power. The electric characteristics are the same, it’s just a pin converter.
Be careful to get the right “direction”: you need a male 3.5” style to “molex 4 pin” female. The converter might be a bit hard to find because most people who needed a converter needed the opposite thing (plug a 3.5” drive on a 5.25”-only power supply). Cabling is not my area, so others might provide you with better information.