P-51D top speed at sea level: 367mph
Ki-84-I-Ko top speed at sea level: probably about 350mph
P-51D top speed at 22,000ft: about 420mph
Ki-84-I-Ko top speed at 22,000ft: 388mph for first prototype, 392mph for second prototype, 415mph reportedly for production model, 424mph in post war American tests
P-51D top speed: 437mph at 25,000ft
Ki-84-I-Ko top speed: see 22,000ft results
Summary, the P-51D is faster in all but the US post war tests done using 100 octane fuel (not all that much of an effect) and a meticulously maintained Ki-84-I-Ko, and above 22,000ft is faster even than that one.