Thinking back, there have been several times throughout the show where Tommy has spoken or interacted with ghosts. This could be his brother, his cousin, other firefighters, even his kid. He's also been driving around in the pickup truck with Jesus, and he's followed his kid onto a bus and then subsequently dropped off at a bar. Having been shot and survived a very self destructive lifestyle, not to mention occupation, im not sure what is real and what isn't. Also a couple of seasons ago there was an episode where he dreamed he was entering hell. Based on this im not so sure that Tommy Gavin didn't die in 911, along with Lou and some others, and the last few years has been their collective spirits' struggle / journey to try and cross over to the other side. Whatever side that may be.....Gavin has seemingly turned his life around (perhaps he is now ready to earn his reward).
If anyone remembers the series Dallas back in the 1980's, Pamela Ewing dreamed away an entire season so that they could bring back Bobby Ewing from the dead...
Whatever, it could just be what it looks like, either way I'm sure gonna miss this show.