It's the same person, but Last Stand and First Class occur on different timelines, thanks to Wolverine changing the past in Days of Future Past. Moira's life from ~1975 onward was rewritten in the process.
Moira McTaggert is a recurring character in the X-Men comic book series, a former love interest of Charles Xavier. So, it would make sense for her to appear in the X-Men movies as well. In the comics, she's a research scientist working on X-gene mutations. When Xavier mentions her in Last Stand it seems like she's probably in that kind of role.
In the movies, the first time we meet Moira is as a CIA agent in the 1960s, working with Xavier and his X-Men in First Class. The two develop a bit of an attraction, and after defeating the Hellfire Club, she helps tare care of the newly-paralyzed Xavier. However, to protect both her and his school, Xavier erases her memory of him and the events that took place.
Sometime after that, Moira clearly left the CIA, but she was still drawn towards mutants. She must have become a geneticist by the time of Last Stand in the late 2000's, and it would make sense that Xavier would keep track of her -- he likely still had feelings for her.
When Wolverine traveled back in time during Days of Future Past, mutants became public knowledge much earlier in history than expected. This caused a number of changes in the world's future dealing with mutants. One of these, presumably, is that Moira never left the CIA, but instead became one of their mutant experts.
The most recent film where Moira has appeared was Age of Apocalypse in the 1980's, where she is still a CIA agent, though she apparently still does not remember Xavier or the events of First Class.