– Kyle Gibson sees nothing wrong with a little comic relief near the end of a long season. And, if it happens be the end of a losing season, it can be salve for wounds suffered through accumulating losses.

“The hardest part is keeping everybody together, and keeping everyone fighting for each other and staying focused on a team atmosphere,” Gibson said. “Aand this brings that.”

What Gibson was referring to Sunday sat to his left in the visitors’ clubhouse at Kauffman Stadium, as reliever Trevor Hildenberger was slipping on a costume of a jockey riding a horse. All around the clubhouse, Twins players with less than one year of service time — along with some staff members in their first season with the club — put on similar costumes as the team’s annual rookie dress-up day took place.

It helped that the Twins beat Kansas City 9-6 Sunday to avoid getting swept in the four-game series, and that the club rang out a season-high 18 hits, that it belted four home runs to tie a season high and that Gibson pitched into the seventh inning in his 30th start of the season to earn the victory.

So the mood was light in the clubhouse afterward. Even if the Twins had lost — another loss will give them 82, clinching a sub-.500 season a year after a playoff appearance — the event would have been a welcome diversion. A total of 18 players and staffers dressed up and went on the outfield about 30 minutes after the final out was recorded and raced from the right-field foul line to the left-field foul line, following the contour of the infield.

Assistant strength coach Erik Beiser dressed up as a bugler, but the Royals actually played a prerace bugle over the sound system as the Twins lined up.

“My goal is to not finish last,” Hildenberger said. “Or embarrass myself.”

The one rule was that contestants had to gallop … or at least gallop as well as they can. Willians Astudillo broke the rule and was disqualified.

Jake Cave, installed as the 6-1 favorite by clubhouse oddsmakers, finished in first. Kohl Stewart named his horse “Gronkowski” and Matt Magill named his “Gidgit.” They tied for last.

It is the first leg of the Twins Triple Crown. The rookies have to race Wednesday at Detroit’s Comerica Park and again Sunday before they leave Oakland.

The council of veterans on the team, including pitchers Gibson, Jake Odorizzi and Matt Belisle, came up with the theme.

“Odorizzi ordered everything and executed the plan to perfection,” Gibson said.

One of baseball’s traditions has been, once a year, for rookies to have their regular clothes swapped out for costumes, typically to be worn during road trips. In past years, some outfits pushed the envelope.

“There’s been some rule changes in what you can dress guys up as and you try to be more sensitive to people who are tuning in,” said Gibson, who had to dress up as a leprechaun during his rookie year in 2013. “We thought about maybe a Noah’s Ark theme, to get then dressed up as pairs. Ultimately, we thought about what if we have a Kentucky Derby.”

The smartphones were out recording everything, and the race provided some laughs as the season winds down. It has been a team-building event as well as a way to break in the newbies.

“Yeah, it’s at the expense of a few young guys — and this year I think we have more young guys than ever,” Gibson said. “But most everyone handles it well and has fun with it.”