My guess - you get sub-ed in to pinch hit for the pitcher, thus taking his roster spot. Your team takes the lead while you're in that roster spot. But then, when you go to play the field, the manager subs in a different reliever.
That's an old one: home team reliever comes in the game in the top of the ninth with visiting team at bat and ahead, two outs and a runner on base. Before throwing a pitch, the reliever picks off the runner to end the inning. In the bottom of the ninth, home team comes from behind to win.
Milton...you are exactly correct. I was watching the Mets-Padres game last night and they mentioned that this has actually happened in baseball history. I had never actually thought of that before. It could theoretically happen in any inning. Tom...you had a super guess. I think (and I could be wrong) that the pitcher has to record an out before he is illegible for the W.