Dani Pedrosa kept his slender MotoGP title ambitions alive by defeating Jorge Lorenzo to claim victory at Motegi.