Mendoza, the Yankees' fifth starter, allowed just four singles, walked one and struck out four in his first start since May 7.
The Yankees, showing the return of their offense for a second straight game, gave him early support, scoring three runs each in the second and third innings to end Baldwin's nine-game winning streak.
Mendoza (5-2) needed just 100 pitches, working quickly to get his second career complete game and shutout. He beat Minnesota with a five-hitter on May 10, 1998.
"He really didn't get in any trouble," Yankees manager Joe Torre said. "He didn't have any stress. Mel (Stottlemyre) and I looked at each other. Why not? Let's go for it (the complete game)."
Baldwin (7-1) had difficulty putting the ball where he wanted to.
"He was a little wild early onm and we got ourselves in good counts to hit in and took advantage of it," said Scott Brosius, who hit a two-run homer in the second to make it 3-0.
I their second straight offensive outburst they scored 12 runs Wednesday night with 18 hits the Yankees got all of their runs with two outs. They finished with 12 hits.
Despite their slump they had lost eight of 11 before the consecutive wins the Yankees headed home tied with Boston for the AL East lead. The Yankees and Red Sox start a three-game series Friday.
Chicago heads into a weekend series against visiting Cleveland atop the AL Central, a half-game in front of the Indians.
Baldwin lost for the first time in 10 starts since the Yankees beat him last Sept. 21. He gave up seven runs and 10 hits in 5 2-3 innings, dropping to 1-5 against New York.
"Bad location today," he said. "And this was a bad day to have bad location. I absolutely stunk. I can't go out and win them all."
Ricky Ledee hit a two-out RBI double in the second and Brosius followed with his second homer.
The Yankees added three in the third, loading the bases with two outs on Paul O'Neill's single, Tino Martinez's double and an intentional walk to Jorge Posada. Shane Spencer hit an RBI single and Ledee followed with another single for a 6-0 lead.
Wilson Delgado hit his first major league homer in the sixth.
©2000 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed