The Rays' win in the series opener -- their fifth one-run game in a row -- and New York's 3-2 loss at Toronto left the teams with identical 77-48 records, tied for best in the majors.
"How 'bout it?" Rays manager Joe Maddon said. "That's pretty interesting. It's much more fun to excruciatingly look at the scoreboard every night."
They also improved on their 38-24 road record, the best in baseball. The Rays have won three straight at Angel Stadium for the first time in franchise history.
Shields (12-11) allowed eight hits and three runs -- two earned -- in six-plus innings, struck out 10 and walked one in his 144th career start, tying Kazmir for most in club history.
"He's been a rock for us the last several years," Maddon said. "He's going to really get on a nice run."
The right-hander from the Los Angeles suburb of Newhall earned his 55th career victory, tying Kazmir's mark, and won in Anaheim for the first time after losing his two previous appearances.
"It's good to get that off my back. Hopefully, I can get a lot more wins," Shields said. "I was commanding my fastball really well. I got in a nice little rhythm."
Rafael Soriano struck out the side on nine pitches in the ninth to earn his major league-leading 38th save in 40 chances.
Kazmir (8-11) gave up five hits and four runs in 5 1/3 innings, struck out four and walked four to fall to 1-6 in his past eight starts. He's pitched into the seventh just once in his past nine starts for the Angels, who are 2-6 in their past eight games.
"If I just got past that first inning without any damage and had been a little bit more economical, it would have been a whole different outcome," Kazmir said. "I settled in nice in the third, fourth and fifth innings. That was me out there. But I put myself in a hole early, and it's frustrating. It puts pressure on everyone when you start the game down three runs."
Upton ended an 0-for-11 skid with his 12th homer and second leadoff home run of the season. Ben Zobrist extended the Rays' lead to 3-0 with a two-run single later in the first.
Upton doubled into the left-field corner in the second, putting the Rays up 4-0.
"I know it sounds like a broken record, but Scott's just having trouble moving forward with some things and he's paying a price for it," Angels manager Mike Scioscia said.
His next time up, Upton flied out to the warning track in left-center in the fourth, then was robbed of a home run by center fielder Peter Bourjos in the sixth. Bourjos also took away a home run from former Angel Sean Rodriguez leading off the second, but the ball bounced off his glove and ended up as a double.
"Those are the first two in the big leagues that I've pulled back," he said. "The ball kind of hung up for me a little bit, so I was able to get back on the ball. I was pretty upset about the first one. It was bugging me in the dugout, but then to get the second one felt pretty good."
Bourjos' play impressed teammate Torii Hunter, who moved from center to right to accommodate the rookie.
"He made the adjustment from the first one. He concentrated a little more and knew the wall was going to be there, and he put the glove out there and took the hit," Hunter said. "It just reminded me of myself. I know the feeling of taking a home run away from other players. That used to be fun."
The Angels trailed 4-2 in the third on Hideki Matsui's two-run double with two outs. They made it 4-3 in the seventh on Howie Kendrick's sacrifice fly.
Juan Rivera made his first career start at first base for the Angels, becoming the eighth player to start there since Kendry Morales' season-ending broken leg on May 29. ... After the game, the Rays optioned RHP Mike Ekstrom to Triple-A Durham and reinstated RHP Wade Davis from the DL to start on Tuesday. ... Rays 3B Evan Longoria was hitless in four at-bats with two strikeouts after being named AL player of the week when he hit .393 last week. ... The Rays concluded a three-day stretch against left-handed starters. They are 30-13, tops in the majors, when an opponent starts a lefty. ... The Angels have lost three of four against the Rays at home, where Los Angeles is 14-4 against them since 2006.