One of the biggest problems in training neural networks is creating high quality data sets. E.g. if you want to classify pictures, you need a huge set of correctly classified pictures as training input. In your scenario, you can automate this laborious job by feeding random data to your blackbox and store the output. Voila, you have your training data.
Your neural network will have the same input and output structure as your blackbox. You can use your generated training data the same way you you would use manually generated training data. I cannot provide any actual implementation, because the training mechanism depends on your technology stack incl. the frameworks you are using. But there is nothing out of the ordinary in your scenario when it comes to the training process itself and you can follow one of the many available tutorials for training neural networks - a pretty basic one for example would be this tutorial for Keras (if that's your choice of framework).