Yes. Graduation in May qualifies for the credit calculation.
Per the IRS, "To qualify as a student, the person must be, during some part of each of any five calendar months of the year". If you graduated on May 1st, then the entire month of May counts as one of your five months and since you started in January and graduated in May, this will count as 5 months.
**Say "Thanks" by clicking the thumb icon in a post**Mark the post that answers your question by clicking on "Mark as Best Answer"
The question about the fellowship teaching counting as being a full time student is academic (it probably doesn't). The fact that you were full time from any day in January to any day in May counts as 5 months.