Dortmund had the majority of the ball, but both teams struggled to create clear chances in a well-matched clash in Winterthur, with the Bundesliga side having only won two of their five pre-season outings under new coach Peter Bosz.
Pablo Piatti came up with the winning goal with 11 minutes to play, the substitute neatly lobbing Roman Burki after the Dortmund goalkeeper was caught well off his line.
Dortmund have just one more pre-season game, against Atalanta, before getting their campaign under way with the DFL-Supercup against Bayern Munich on August 5.
Andre Schurrle was denied an early penalty when he went down under an untidy challenge from Espanyol captain Javi Lopez as Dortmund made a bright start.
Leo Baptistao shot over the angle under pressure from Lukasz Piszczek after 11 minutes before Pierre-Emerick Aubameyang fired wide from 10 yards when he should have scored.
Mario Gotze could only touch a lofted throughball straight at goalkeeper Pau Lopez at full stretch and, with Dortmund dominating possession, Gonzalo Castro drove a shot just over the crossbar after a powerful run.
Sergio Garcia had a clear sight of goal four minutes before half-time, but the Espanyol striker picked out Burki.
Mahmoud Dahoud was introduced for his Dortmund debut at the interval, but Espanyol had the first chance of the second half after Garcia created an opening only to shoot at Burki again.
Despite the game being played at a good tempo for a pre-season outing, the final pass lacked quality for both sides and chances were at a premium at either end.
Lopez saved a skimmed Schurrle shot after 68 minutes, but neither goalkeeper had been particularly stretched despite the raw speed of Ousmane Dembele causing problems for Espanyol.
But Burki's error of judgment, coming off his line for a ball he could not reach, cost Dortmund a draw as Piatti kept his nerve to lift the ball over the goalkeeper's head and in for the winner.