I think that your playing in both files is pretty good, but when playing with a backing tracking you have to pay attention to where the track is and the tempo of the track then ensure that you are playing at the same speed. as you can hear in your file you ended a second or two before the track, which means that you were not in time with it.
This will come with practice.
What is interesting is that when I play it in the Audacity project, it sounds fine, although I did get a slightly ahead of the backing track in places. Downloading and listening to the MP3 that I uploaded it is very far off. I have made latency adjustments to tighten things up when recording but it obviously didn't address this. I will experiment some more and listen to the MP3 this time before uploading it.