Marcus are you talking about the sustain pedal. Or do you mean an expression (volume) pedal. Not sure what you mean by it using midi.
If it is the sustain pedal the answer will depend on how the sustain pedal is configured. Does the pedal have a standard jack on the end of the lead? When the pedal is up (ie not pressed ) then the jack contacts will either short out (NC or normally closed) or remain open circuit. (NO or normally open) When the pedal is pressed then a NC pedal becomes NO and a NO pedal will become NC.
You can use this with the piano as long as the piano expects the pedal to behave the same way. If the pedal however is wired the wrong way for the piano then you cannot really use it. You can easily test it by simply plugging it in. Don't press it to start with. If all the notes are sustaining when the pedal is not pressed (and not sustaining when the pedal is pressed) then you cannot really use the pedal with the piano. If the pedal does not work properly with the piano ie the wrong way around, some pianos are smart enough to detect pedal polarity on switch on and set themselves accordingly. Try turning the piano off with the pedal connected and turning it back on and see what happens. This may not work either. There may be a setting for pedal polarity in the piano settings and you will have to do it manually.
Check the pedal itself. Some of them have a little switch on the bottom which can reverse its behaviour too.
Then you could be lucky and the pedal will behave as per normal. ie not sustaining when not pressed and sustaining when pressed. You wont damage the piano by doing this only you will find out if it is going to work or not.
Now if you are talking about a volume or expression pedal things are a little more complicated then. There is a good chance it wont work.