For the Mets, the struggles of every starter not named Matt Harvey have been well-documented, their rotation battered and beleaguered all year. But Dillon Gee, who has suffered as badly as anybody, pitched a gem in last night’s 3-2 win over the Pirates, deserving of a far better fate than the no-decision he got.

Gee pitched five-plus innings, allowing five hits and only one earned run, that coming after he departed the game with a 1-0 lead. Granted, he left a bases-loaded, nobody-out mess for reliever Brandon Lyon in the sixth, but on yet another night when the bats went to sleep, Gee kept the Mets in the game.

“I was pleased. I don’t think it was great or bad, it was just average. It’s going in the right direction. I felt pretty good, but obviously Lyon came in and got me out of the big jam,’’ said Gee, who said he did not have his best changeup.

“The last couple outings, to come back today and pitch the way I did, and make good pitches when I really needed to, I feel like I was a lot better than I have been, and that’s the way it needs to be shifting right now.’’

After allowing nine hits and four runs in just five innings last week in Miami, Gee came into last night with a 2-4 record and a bloated 6.16 ERA. He had coughed up four or more earned runs in four of his first six starts this season, an

d desperately needed an outing like last night’s to snap out of his malaise. “The way the game started I thought he was going to have a big night,’’ said manager Terry Collins. “His stuff was crisp. In the first two innings, boy, he made good pitches. I told Dan [Warthen, the pitching coach] he’s going to get us to the seventh inning, and I looked up in the fifth and he had 80-some pitches. Hopefully he builds on this, because he threw the ball good.’’