Hint :
If A is to win , then there can at most be 9 match and in the last match A must win since after that the game stops. (If there are 10 or more than 10 games, then B must already have won 5 games, so A can't win, in fact in this sort of series at most 9 games can be played ... )
So if A finishes the series by winning the 9-th game , then A will have to win some 4 of the remaining 8 games. which can happen in C(8,4) ways.
and if A finishes the series by winning the 8-th game , then A will have to win some 4 of the remaining 8 games. which can happen in C(7,4) ways.
and if A finishes the series by winning the 7-th game , then A will have to win some 4 of the remaining 8 games. which can happen in C(6,4) ways.
and if A finishes the series by winning the 6-th game , then A will have to win some 4 of the remaining 8 games. which can happen in C(5,4) ways.
and if A finishes the series by winning the 5-th game , then A will have to win some 4 of the remaining 8 games. which can happen in C(4,4) ways.
Since all those cases can't overlap (mutually exclusive), in order to find total number of ways, we just need to add them
So total number of ways = C(8,4) + C(7,4) + C(6,4) + C(5,4) + C(4,4) = 70 + 35 + 15 + 5 + 1 = 126
PS: I'm being reminded of Shampoo