SAN DIEGO (AP) -- The Arizona Diamondbacks came into a three-game series against the Padres with the worst record and worst ERA in the majors.
The Diamondbacks won the first two games and took a 3-1 lead in the fourth inning on Sunday before letting the Padres tie it and then win it 4-3.
Even so, the Diamondbacks leave town having finally cracked double digits in wins and passed Houston by one percentage point for the big league low.
''I feel good about where we are at,'' said catcher Tuffy Gosewisch, who hit a two-run single in the fourth-inning. ''We did some good things in this series, and I think things are headed in the right direction.''
Maybin easily beat the throw home by first baseman Paul Goldschmidt, who was playing in with one out. Alonso entered during a double switch in the top of the inning.
The Padres snapped a four-game losing streak and scored their most runs in five games.
Maybin started the winning rally with a chopper to second off Oliver Perez (0-1). He initially was called out but Padres manager Bud Black challenged, and the call was changed, giving Maybin an infield single. It made Black 2 for 2 in challenges on Sunday and 4 for 4 for the season. Rene Rivera, who earlier hit a two-run double, doubled over right fielder Gerardo Parra's head to move Maybin to third.
Huston Street (1-0) pitched the ninth for the win.
After being held to five runs in their previous four games, the Padres scored first for the first time in five games. Chris Denorfia's two-out single in the third brought in rookie Jace Peterson, who was hit on the hand with a pitch.
That snapped a streak of 20 scoreless innings by Diamondbacks pitchers.
Arizona went ahead 3-1 in the fourth. Goldschmidt hit a leadoff homer off Tyson Ross into the sandy play area beyond the fence in right-center, his fifth. With two outs, shortstop Everth Cabrera misplayed a grounder by Cody Ross for an error. Rookie Ender Inciarte singled to left and Gosewisch brought them both in with a single to center.
''It felt good to contribute,'' Gosewisch said.
San Diego tied it in the bottom half when Rivera hit a two-out, two-run double into the left-field corner off lefty Wade Miley. After Yasmani Grandal hit into a double play, Maybin and Will Venable singled ahead of Rivera.
''That was my fault,'' Gosewisch said. ''I called for a slider and we just didn't' get it where we wanted it.''
Ross allowed three runs, one earned, on seven hits in seven innings, struck out five and walked one. Miley gave up three runs and six hits in seven innings, struck out four and walked one.
Black challenged a ruling that Chris Owings was safe on a grounder with two outs in the eighth. After review, Owings was called out.
NOTES: Padres 3B Chase Headley will start a rehab assignment at Class A Lake Elsinore on Monday. He's on the DL with a strained right calf. ... The Padres continue a 10-game homestand with a three-game series against Kansas City starting Monday night. The scheduled starters are Royals RHP Yordano Ventura (2-1, 1.50 ERA) against Padres lefty Eric Stults (1-3, 5.34). ... The Diamondbacks continue their trip by opening a three-game set at Milwaukee. Mike Bolsinger (1-1, 5.79) is scheduled to start for the Diamondbacks against Matt Garza (1-3, 5.00).