The Wall Street bank will pay $5m to settle a paternity case which lawyers say is the first of its kind.