Just set up two simple simultaneous equations:
First, let P = Peter's starting money
and D = David's starting money
P = 5*D (Peter has 5 times as much as David)
P - 28 = D + 28 (Peter gives $28 to David, and both have the same now)
P = D + 56
substitution reveals that
D + 56 = 5D
56 = 4D
Therefore,
David = 14, and Peter = 70