Germany couldn't find an answer for the Gasols, a double threat down low. Spain led most of the way but needed a late 9-3 run to secure the victory. The Gasols scored Spain's last nine points, with seven by Pau.
"At the beginning we didn't play very smart, shooting too much from outside and not finding our rhythm. We got ahead a couple of times, but we weren't able to pull away," said Pau Gasol, the Los Angeles Lakers center who is playing with a sore ankle.
Nowitzki, who led the Dallas Mavericks to the NBA championship last season, had 19 points for Germany. Chris Kaman of the Los Angeles Clippers had 15 points and 12 rebounds, but both shot under 50 percent.
"We could not get the important baskets and rebounds at the end, and we turned the ball over too much," Germany forward Johannes Herber said.
The loss leaves Germany in danger of missing the quarterfinals. Since head-to-head results from the first group stage carry over into this round, Germany is now 0-3, while Spain is 2-1 in their Group E.
Four teams from each group advance to the quarters. France is 3-0, Lithuania is 2-1 and Turkey and Serbia 1-2.
Lithuania fed off the energy of its home crowd and used its trademark quick passing to set up good shots.
"We played with emotion, our assists and shooting won the game," said center Jonas Valanciunas, who had 18 points.
Lithuania shot 60 percent and made 11 of 20 3-point attempts. Point guard Mantas Kalnietis connected on five of seven from beyond the arc and finished with 19 points. Nenad Krstic led Serbia with 21.
Spain took a nine-point lead on Pau Gasol's basket with less than six minutes remaining in the third quarter. But Germany kept coming back and Nowitzki's consecutive baskets at the end of the third and the start of the fourth put Germany up by one.
With Spain up by seven with less than two minutes to go go, Germany missed a couple of shots — including a jumper by Nowitzki — and Ricky Rubio made a key steal to help Spain cruise home.
"We couldn't play our running game, they stopped us very well, but we took control in the last five minutes," said Rubio, recently signed by the Minnesota Timberwolves.
Germany had twice as many turnovers as Spain with 16.
"That's too many at a European championship," Nowitzki said. "We are not far from the top teams but in the decisive phase they switch into a higher gear and we make a couple of mistakes. That makes the difference."
Parker made seven of eight free throws in the final 18 seconds to lift his team past Turkey, although France nearly squandered a 15-point lead.
"It's a very big step toward the quarterfinals, but we are not there yet," France coach Vincent Collet said.