It's quitting if you say, "I can't work this schedule anymore so I'm quitting." It's a discharge if the employer says, "you're never available when we need you so we're letting you go." In the end, it only matters if this job was your LAST employer.
Very state dependent, and I don't want to look it up. On a percentage basis though, working there 5 months is enough to purge a disqualification from a job that you quit. However, I'm getting the feeling that you worked two jobs concurrently right up until you get let go, and in a case like that, timing of the discharge/quits can mean all the difference between a UI check or nothing at all.
Depends on the state, but if I were to guess, you could quit the 1st job now, take the better job, and if you get laid off or fired for a nondisqualifying reason, you would get UI benefits.

