The penalty means Piastri's McLaren teammate Lando Norris, winner last time out in Miami, starts on the front row alongside championship leader Max Verstappen, on pole for Red Bull.
Charles Leclerc of Ferrari now leads up the second row alongside stablemate Carlos Sainz while Piastri lines up on the third row with George Russell of Mercedes.