The All-Star closer worked the ninth for his 33rd save, and the Dodgers edged the division-leading Arizona Diamondbacks 3-2 on Friday night.
Los Angeles moved within a game of Arizona, while Colorado dropped 1 1/2 games back after a 7-0 loss in San Diego.
"Every game counts," Jansen said. "That's motivation. That's what fuels me."
Jansen had been shaky since coming off the disabled list, allowing seven earned runs in four innings over four appearances. He was sidelined by an irregular heartbeat.
Helped by pitching coach Rick Honeycutt, he worked out some mechanical issues during a bullpen session in Texas earlier this week. He also watched video of himself from the last two years.
"I feel great," Jansen said. "Just got to figure it out."
"That was huge," teammate Justin Turner said of Jansen. "He looked pretty electric."
Turner homered on Zack Greinke's first pitch of the eighth inning for the go-ahead run in his fourth at-bat against his former teammate.
"Got a slider he left up, one of the few he left up all night," Turner said.
Enrique Hernandez tied it at 2 with a pinch-hit, two-strike, opposite-field homer off Greinke with two out in the seventh.
Dylan Floro (5-3) got the win with one strikeout in one inning of relief.
Greinke (13-9) gave up six hits in 7 1/3 innings. He struck out five and walked one.
"I've been feeling good for the past month at least, maybe longer late in games, to where I've felt like I could pitch a whole other game," Greinke said. "Today was one of those. I felt really good."
Goldschmidt slugged a two-run shot, his team-leading 31st of the season, in the first. Goldschmidt has reached base in 43 straight road games, extending his club record.
Joc Pederson's RBI single in the third left the Dodgers trailing 2-1.
The D-backs had the potential go-ahead run on third base in the eighth. Ketel Marte reached on an error by Floro, got sacrificed to second by Greinke and took third on Floro's wild pitch. But Steven Souza Jr. grounded out to Floro to end the inning.
Diamondbacks: RHP Shelby Miller (right elbow tightness) played long toss with a plan to increase his workload next week. ... OF Jarrod Dyson (right groin strain) was set to have three at-bats in a game with Triple-A Reno on Friday night.
Dodgers: RHP John Axford (right fibula fracture) is off crutches and playing catch in Arizona, but has yet to throw a bullpen or face hitters. ... RHP Ross Stripling (low back inflammation) threw a bullpen and came out of it well. The team has yet to decide on a plan for him.
FREESE IN LA
In the ninth, the Dodgers announced they had acquired third baseman David Freese from the Pirates in exchange for minor league infielder Jesus Manuel Valdez.
"Definitely happy to have him," Turner said. "He's a professional hitter. I love watching him take his at-bats."
Manager Dave Roberts said Freese would be used off the bench against left-handed pitching.
HOT AUGUST NIGHTS
Turner went 2 for 3 and got hit by a pitch. He finished August hitting .402 with 22 runs, 11 doubles, one triple, six homers and 20 RBI in 25 games.
GOLDY VS LA
Goldschmidt's homer was the 31st of his career against the Dodgers, most among active players vs. Los Angeles. He finished 2 for 4 with a double.
Patrick Corbin (10-5, 3.15 ERA) starts for the Diamondbacks against fellow lefty Clayton Kershaw (6-3, 2.39 ERA). Corbin is 1-0 with a 0.98 ERA in three starts against the Dodgers this season. Since the All-Star break, Kershaw is 3-1 with a 1.85 ERA, 46 strikeouts and three walks.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
D-backs host Giants on anniversary of Big Unit's perfecto
On the 15th anniversary of Randy Johnson's perfect game at Atlanta, the Arizona Diamondbacks are far from perfect with their rotation heading into their Saturday game against the San Francisco Giants in Phoenix.
Surging Twins look to keep winning at Seattle
The Minnesota Twins will take their fourth four-game winning streak of the season into a Saturday night road game against the Seattle Mariners.
Royals seek to even series with Angels
Los Angeles Angels manager Brad Ausmus is happy to have the option of putting Shohei Ohtani in the lineup Saturday night against the Kansas City Royals, though it would only be as the designated hitter.
Pirates leaning on bullpen in matchup with Padres
Usually when it says "TBA" in the probable pitching line for a team, it means the manager knows who the pitcher is ... he just can't identify him because he's coming off the injured list or being promoted from the minor leagues.
Brewers, Braves have hurlers back from injury, suspension
Two pitchers sidelined for different reasons will square off when the visiting Milwaukee Brewers play the Atlanta Braves on Saturday.
Marlins' Lopez looks to improve on dismal outing vs. Mets
Miami Marlins right-hander Pablo Lopez is set to make his 19th career major league start on Saturday. The two outings he had against the New York Mets likely stand out as the most memorable.