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 had been swayed that way. Dumbledore refused him the chance of being a teacher because Dumbledore did not like Tom Riddle, with good reason.
Following the wiki, most teachers had N.E.W.T.'s at least 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 OOTP. Take, for instance, Hagrid who was the Care for Magical Creatures teacher; he had been expelled in year 3. There is also 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 had 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 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 who was chosen as the teacher had 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.