First of all, while Memory Alpha is a great resource (and I'm sure the show's creators appreciate it as such), it's a wiki and it's far from infallible. It's also not canon per se, although it usually does a decent job of making clear whether what it's describing is or isn't.
Second, nothing about what you quoted says Thing One about what Scotty was doing in the 2250s, except that he wasn't yet a Chief Engineer. The same entry confirms that he (as of "Relics") he had served on 11 different ships over the course of his Starfleet career, so obviously he moved around a fair bit. It's eminently reasonable to suppose that he could have served under Pike for a while, or even simply visited the Enterprise temporarily for some reason or another. If you're reading the entry as saying Kirk's command was necessarily the Very First Time he set foot on the Enterprise, you're reading in more than the entry actually says.
Second, nothing about what you quoted says Thing One about what Scotty was doing in the 2250s, except that he wasn't yet a Chief Engineer. The same entry confirms that he (as of "Relics") he had served on 11 different ships over the course of his Starfleet career, so obviously he moved around a fair bit. It's eminently reasonable to suppose that he could have served under Pike for a while, or even simply visited the Enterprise temporarily for some reason or another. If you're reading the entry as saying Kirk's command was necessarily the Very First Time he set foot on the Enterprise, you're reading in more than the entry actually says.