come out on top vs gain mastery

come out on top

gain mastery

How often have the words come out on top and gain mastery occurred in a corpus of books? (source: Google Ngram Viewer )