CHICAGO -- The last time John Baker threw a pitch in a game, he was playing in the Cape Cod League.

Early Wednesday morning, in a game against the Colorado Rockies that started Tuesday night at Wrigley Field, the Chicago Cubs' backup catcher was back on the mound as a pitcher.

He threw a scoreless 16th inning in the longest game, time-wise, in Cubs history and earned his first professional win in Chicago's 4-3 victory.

"It's really cool," said Baker, who also scored the game-winning run in the bottom of the 16th on a sacrifice fly by shortstop Starlin Castro. "I was having trouble not smiling on the mound, because you never get an opportunity to do things like this.

"I think about how many pitchers I played with who were really good and never got a chance to pitch in the big leagues. It's something I will definitely cherish for a long time."

Throwing pitches that traveled between 75 and 79 mph, Baker (1-0) got a foul pop for the first out of the 16th. After issuing a walk, he induced a double-play grounder from Colorado shortstop Cristhian Adames, who was making his major league debut.

Afterward, Baker got the traditional beer shower from his teammates for his first win in the majors.

"I got beer, I got chocolate milk, I got hair gel, I got shampoo, I got body wash and then I got some more beer," Baker said of the postgame celebration. "It was great. Best shower I've ever taken. I need some photographs, I need a ball and a lineup card, because that thing is going to replace my first hit in the big leagues ... my first win in the big leagues."

Baker became the first Cubs position player to pitch since Joe Mather did it Aug. 27, 2012, against the Milwaukee Brewers. He got the opportunity only because the Cubs already burned through seven relief pitchers.

"That wasn't the plan," Cubs manager Rick Renteria said. "That wasn't the game plan when we started, but obviously that's the way it ended."

The game, which lasted 6 hours, 27 minutes, set club records for time for each team. The previous Cubs record was 6 hours, 10 minutes against the Los Angeles Dodgers on Aug. 17-18, 1982. The previous record for the Rockies was 6 hours, 16 minutes on April 17, 2008, against the San Diego Padres.

In the bottom of the 16th, the Cubs loaded the bases against Rockies left-hander Tyler Matzek (2-5). They finally ended the marathon game on Castro's liner to right.

"It was different," said Matzek, a starter. "But I've thrown in the (bullpen) before and had a routine down, so it wasn't anything crazy. I just didn't execute."

Cubs third baseman/center fielder Emilio Bonifacio went 4-for-7 and smacked a two-run homer off Rockies starter Jorge De La Rosa in the fourth inning that created the 3-3 tie, which held for the next 11 1/2 innings.

Colorado squandered an opportunity to break the tie in the top of the 10th. Following a one-out double by shortstop Charlie Culberson that put runners at second and third, Rockies second baseman DJ LeMahieu missed a bunt attempt on a squeeze play with Justin Morneau lumbering down the third base line.

Cubs catcher Welington Castillo ran Morneau down for the second out, and LeMahieu then struck out against right-hander Blake Parker to end the inning.

Castillo nearly ended the game in the bottom of the 10th, but his line drive with Castro on second was snagged with a great leaping catch by center fielder Charlie Blackmon -- who also snared a liner by Castillo in the first that would have scored two runs.

Chicago starter Edwin Jackson lasted only four innings and received a no-decision, which was part of the reason the bullpen was expended in extra innings.

De La Rosa also received no decision after going six innings and allowing three runs on six hits. He struck out seven and walked just one, giving up a run in the first and two in the fourth on the homer by Bonifacio.

Jackson exited after throwing a whopping 105 pitches (64 strikes), with his early exit continuing a disturbing trend. He lasted six innings in only eight of his 22 starts, and this was the fifth time he did not last at least five.

The Rockies, who lost for the third straight game, scored three times on three hits in the first inning off Jackson and didn't score again. They got run-scoring doubles from third baseman Nolan Arenado and Morneau, who was activated from the 15-day disabled list prior to the game.

"When you go 15 innings without scoring a run, you don't deserve to win," Colorado manager Walt Weiss said. "Three runs in the first, starter's out (of) the game early. If you can't win that game, you don't deserve to win."

NOTES: Before Cubs C John Baker, the last major league position player to earn a pitching win was Baltimore Orioles 1B Chris Davis on May 6, 2012, against the Boston Red Sox. ... The Rockies activated 1B Justin Morneau and LHP Boone Logan from the 15-day disabled list and called up rookie INF Cristhian Adames from Triple-A Colorado Springs. In order to make room on the 25-man roster, RHP Brooks Brown, RHP Chad Bettis and 1B Ben Paulsen were optioned to Colorado Springs. ... Rockies SS Troy Tulowitzki, who is on the DL with a hip flexor strain, will resume baseball-related activities Wednesday. ... Cubs GM Jed Hoyer said the team is having discussions about potential trades as the July 31 deadline approaches. "A lot of conversations," Hoyer said. "I think we'll be active. It wouldn't surprise me if we made no moves, but I guess I'd say I expect to be active. We're having a lot of conversations. It's still early. (Wednesday) is sort of moving day and I'd expect things to get a lot more serious as we move into (Wednesday)."