avanchnzel, has the idea. However, I would make a small amendment. As I said above, order matters. Doing the following: damper down, sostenuto down, damper up; would render the damper ineffective until the sostenuto is raised up. Remember, the sostenuto catches the damper position regardless if it is your hands or the damper pedal holding the dampers up. This is easier to visualize if you are at the piano and looking at the dampers as you move the pedals.
Here's what I would do:
Play RH, LH chords; damper down
Hold RH chord, release LH chord
Play bass note and hold with fingers
Damper up
Sostenuto down
(Damper down optional)
Release LH bass note
Play RH, LH chords, damper down