Jon Jay connected for his third career pinch-hit homer and Ian Happ hit a tiebreaking two-run single an inning later, helping the Cubs rally for a 7-3 victory over the Tampa Bay Rays on Wednesday.

Chicago (42-42) returned to .500 for the 19th time with its third win in its last eight games. The reigning World Series champions have not been more than two games over or two games under .500 at any point since May 27.

The Cubs trailed 3-0 before Jay drove a 1-2 pitch from Erasmo Ramirez (4-3) over the wall in left-center for a tying homer with two out in the sixth inning. Jay then popped out of the dugout for a curtain call, obliging the crowd of 39,855 on a picturesque day at Wrigley Field.

Happ got his big hit in the seventh, driving in Kris Bryant and Anthony Rizzo with a bouncer up the middle against Tampa Bay's drawn-in infield. Happ had two hits and is batting .357 (10 for 28) in his last seven games.

Tampa Bay (44-42) wasted a chance for a two-game sweep in its reunion with Maddon, who skippered the Rays for nine years before leaving after the 2014 season and taking over the Cubs.

Mallex Smith went 4 for 4 and scored three times for the Rays, who had won three of four. Blake Snell pitched five scoreless innings in his best outing of the year, working around four hits and four walks.

Smith doubled and scored on Evan Longoria's sacrifice fly in the sixth, giving Tampa Bay a 3-0 lead against John Lackey. But that was it for the Rays.

Pedro Strop (3-2) replaced Lackey and pitched a scoreless seventh for the win.

Tampa Bay was only down by two when it put two runners on against Carl Edwards Jr. with two out in the eighth. But Koji Uehara came in and struck out Longoria to end the inning.

Mike Montgomery (1-5, 2.80 ERA) faces Brewers RHP Zach Davies (9-4, 5.03 ERA) on Thursday afternoon in the makeup of a May 20 postponement. The Cubs then host Pittsburgh for a weekend series beginning Friday.