It wasn't the increased power of the P-40Q's engine, but the greatly improved altitude performance. (2-stage supercharger)
If you look at the actual power ratings (WEP) the P-40E had 1440 hp available at low altitude. However power dropped rapidly above 5,000 ft. Mil power is often listed for the performance figures which was usually 1,125 hp. The P-40M/N's V-1710-81/99 engine had significantly better altitude performance due to a higher supercharger gearing ratio (at the expence of max bost at low alt due to risk of detonation) and had a crit alt of 10,500 ft for 1,480 hp for high speed level flight, and 1,125 hp at 17,500 ft. (added ram effect at high speed) (for safety takoff was limited to 1,200 hh, originally 1,360 hp)
Those gave the P-40N a top speed of 378 mph at 10,500 ft, and 362 mph at ~19,000 ft. With the same engine the P-51A did 415 mph at 10,500 ft, and 408 mph at ~18,000 ft.
And the P-40E's V-1710-39 or F3R engine had a max boost of 60" hg at low altitude giving power levels of 1,570 hp, giving the P-40E a performance atvantage below 8,000 ft. (the P-40K with -73/F4R engine moreso) Overboosting produced power levels in excess of 1,700 hp.
Perils P40 Archive Data
http://www.raafwarbirds.org.au/targetvraaf/p40_archive/pdfs/Allison 1710-39 abuse.pdf