Lando Norris won a thrilling Sao Paulo Grand Prix to take command of the Formula 1 title battle as Oscar Piastri struggled to fifth.