When I am jamming along a song, I do get carried away especially after the chorus when strumming is emphasised. I tend to speed up. You see in intro strumming is kinda not so much emphasised, it's calm and nice but during the Chorus, you could here more of drums or rhythm guitar, at this point I tend to get carried away and not keep up with the tempo of the song. Example is "God is Able" cover by Brian Wahl. Check on YouTube. How do I work on this?
We're nearly into the old chestnut 'metronome versus backing track', and both have their place, at different points.
Your problem seems to be when something is simple, you keep up, and when it gets more complex and exciting, you speed up. Seems to be a common fact - happens when people speak, at very least. And quite a few drummers are prone to it - myself included.
Simple answer is better listening. At the point you go off on one, so to speak, you need to switch both ears to max. What is happening is that your natural rhythm pulse is taken over by excitement, whatever, and ears tend to take a back seat.
Now - practice - as with most things, will improve matters. But how? Leaving out the extra problem of strumming for now, simply use a metronome (or backing track..!) set for say, 100bpm. Clap/tap along to it, get the feel of the rhythm, walk away, and hear if you're still in time a few seconds later, on returning. Change the bpm, maybe the feel of the backing track (straight to swing, for example), and repeat.
Counting out loud sometimes helps, with emphasis, rather like a lot of pieces, on one.
Back to metronome! Said a few times, use it in different ways. Set for, say, 70bpm, and use the clicks not as 1-2-3-4 but &-&-&-&, so you clap where 1-2-3-4 would be. Or set for 70bpm and make each click mean 2 and 4, you clapping the whole 4 beats.This will internalise rhythms in a different way. There's a myriad of other ideas using this concept - impossible to do with backing tracks - even mere drumtracks.