Nasdaq Gains for Fifth Day Despite Monthly Losses