Do you just need to be very good in the subject you want to teach?
You need this amongst other things, for example Voldemort was very good at Dark Arts and probably the defense of them if he would have been swayed that way. Dumbledore refused him the chance of being a teacher because well Dumbledore did not like Tom Riddle with good reason.
Following the wiki, most teachers had N.E.W.T's atleast in their subject.But was that necessary? Could the headmaster hire anyone, regardless of his curriculum?
The headmaster could certainly hire anyone he wanted this may later or at the time be disputed by the governors of Hogwarts or by whatever position Umbridge occupied for the OOTP. Take for instance Hagrid who was the Care for Magical Creatures teacher he had been expelled in year 3, and Firenze who was a Centaur and taught Divination.
For example, could Dumbledore engage Sirius Black as DADA teacher when he was still sought by the ministry for murder?
The ministry gave Dumbledore a lot of slack but I doubt they would have let him use Sirius Black. Perhaps when he gets cleared (to ignore spoilers)....
In my opinion inferred from canon
Experience seems to go a long way or at least it does with Dumbledore, throughout the series we have many new DADA teachers and also a new Potions Master and a new Care for Magical Creatures teacher. Slughorn replaced Snape as he is better with Potions, or so we think from canon possibly Dumbledore did whatever it would take to get Slughorn back. We had Lockhart as a DADA he was useless but his apparent Experience more than likely got him the job. Next we got Lupin whilst I'm not sure of his grades he was very smart in school, he was probably the best DADA teacher we see. Next we get moody who most likely did not have a newt but was very good at his job as a Dark Wizard Catcher or Auror so who better to teach DADA. Umbridge, I'll just move on. Snape he is smart enough and a likely enough candidate to have a NEWT in DADA, we didn't get to see much of his teaching. For the CMC Hagrid was chosen as the teacher who has no qualifications at all, but loves animals and all things dangerous so he was hired.
I think you're asking as you're curious if there would be a central teaching degree that one needs to pass to be able to take care of and teach young children - late teens. This does not seem to be the case in the Wizarding World, it seems to be almost entirely up to the Headmaster/mistress of the time and possibly the Governors. I'm not sure on the Governors because I feel like Lucius would have tried to get Hagrid fired during the Hippogriff incident.