As you have stated that you did not have any any job initially and only during the process of interview of the first job, you got an offer of the second one. With your submission, you joined the 5 months ago and under that case, you will have to ensure that whether you are under the probation period or not. In case, you are under probation and any bond is attached has been furnished for the non - fulfilment of discharging for the said period, you would have to submit the bond money coupled with any money for being defaulter in rendering your service in the present organisation and then only your resignation would be accepted. You will be provided with a relieving letter so that you can join the second job smoothly.
However, if you have completed the bond period and have discharged your duty for the period as stated in the joining letter, you can submit your resignation and upon approval of the same, you can join the second job.
In your case, NOC is not applicable since you did not render the first job of sufficient length.