It is a common strategy to predict oncogenes by differential analysis between somatic mutations and background mutations. Most previous methods only utilize mutations in the cancer population to model its background mutation, which have an obvious bias. A recent method, DiffMut, improves this issue by conducting differential mutational analysis with both mutations in the cancer population and the natural population. However, it assumes the impacts of all mutations are equal, neglecting their functional difference. Thus, we developed a method, DGAT-onco that integrated the functional impacts of mutations to the differential mutational analysis framework of DiffMut. We performed DGAT-onco analysis with 33 cancer types from the Cancer Genome Atlas (TCGA) dataset. Its reliability was further evaluated on an independent test set including 22 cancers from other sources (TS22). Using oncogenes from the Cancer Gene Census (CGC) as the gold standard, our method achieves higher classification performance in oncogene discovery than five alternative methods (i.e., DiffMut, WITER, OncodriveCLUSTL, OncodriveFML, and MutSigCV) with an average AUPRC of 0.197 and 0.187 in TCGA and TS22 respectively. The source code and supplementary materials of DGAT-onco are available at https://github.com/zhanghaoyang0/DGAT-onco.