Yes. You can route MIDI out to the keyboard, then patch the audio output of the keyboard back into your soundcard and record it. It's done all the time....
The midi track sends instuctions to the keyboard, which triggers the sounds and returns them to the recording software via your sound card.
This assumes you already have the midi track. If you are looking to record the midi track first, run the midi out from your keyboard into the sound card's midi in connection, then setup a midi track in your software, arm it, and record.