Masterful means strong ability and personality; inclined to play the master; domineering, imperious: “The leader controlled the rowdy and chaotic mob is such a masterful manner that everybody felt convinced of his confidence.”
Masterly , on the other hand, mean worthy of authority through knowledge or superior skill. “The hall resounded with thunderous applause when the dancer ended her masterly performance.”