Where are you getting 105 from? Person A gets $5 in dividends tomorrow and the stock price drops by the same amount. It's now a $95 stock. Your account equity drops by that amount. Your cash account goes up by 5. The net sum is ZERO! How are you getting this "extra" $5 for free. How do you think companies pay for their dividends? It comes out of their stock.
The $100 is part of Person B's account now from selling. The $5 goes to Person A's account from dividends.
Initial wealth of everyone in the stock market: $100
Final wealth of everyone in the stock market: $105
So where is the zero sum?