Sharp constant of an anisortropic Gagliardo-Nirenberg-type inequality and applications