"But God hates hypocrisy and falsehood. Ananias and Sapphira practiced fraud in their dealing with God; they lied to the Holy Spirit, and their sin was visited with swift and terrible judgment. When Ananias came with his offering, Peter said: “Ananias, why hath Satan filled thine heart to lie to the Holy Ghost, and to keep back part of the price of the land? Whiles it remained, was it not thine own? and after it was sold, was it not in thine own power? why hast thou conceived this thing in thine heart? thou hast not lied unto men, but unto God.” AA 72.2 “Ananias hearing these words fell down, and gave up the ghost: and great fear came on all them that heard these things.” AA 73.1"
"But Peter said, Ananias, why hath Satan filled thine heart to lie to the Holy Ghost, and to keep back part of the price of the land?"
The EGW passage directly quotes Acts 5:3.
"“Whiles it remained, was it not thine own?” Peter asked. No undue influence had been brought to bear upon Ananias to compel him to sacrifice his possessions to the general good. He had acted from choice. But in attempting to deceive the disciples, he had lied to the Almighty. AA 73.2"
"Whiles it remained, was it not thine own? and after it was sold, was it not in thine own power? why hast thou conceived this thing in thine heart? thou hast not lied unto men, but unto God."
The EGW passage directly quotes Acts 5:4, indicating a clear and intentional allusion.
"“It was about the space of three hours after, when his wife, not knowing what was done, came in. And Peter answered unto her, Tell me whether ye sold the land for so much? And she said, Yea, for so much. Then Peter said unto her, How is it that ye have agreed together to tempt the Spirit of the Lord? behold, the feet of them which have buried thy husband are at the door, and shall carry thee out. Then fell she down straightway at his feet, and yielded up the ghost: and the young men came in, and found her dead, and, carrying her forth, buried her by her husband. And great fear came upon all the church, and upon as many as heard these things.” AA 73.3"
"And Peter answered unto her, Tell me whether ye sold the land for so much? And she said, Yea, for so much. Then Peter said unto her, How is it that ye have agreed together to tempt the Spirit of the Lord? behold, the feet of them which have buried thy husband are at the door, and shall carry thee out. Then fell she down straightway at his feet, and yielded up the ghost: and the young men came in, and found her dead, and, carrying her forth, buried her by her husband."
The EGW passage is a direct quotation of Acts 5:8-10.
"hidden sin of the heart, and that He will not be mocked. It was designed as a warning to the church, to lead them to avoid pretense and hypocrisy, and to beware of robbing God. AA 73.4"
"Be not deceived; God is not mocked: for whatsoever a man soweth, that shall he also reap."
Both passages address the principle that God cannot be deceived and that actions have consequences. The EGW passage applies this principle to the specific context of hypocrisy and robbing God, but the underlying principle is the same as in Galatians 6:7.