<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2023-12-08</periodOfReport>

    <issuer>
        <issuerCik>0001707753</issuerCik>
        <issuerName>Elastic N.V.</issuerName>
        <issuerTradingSymbol>ESTC</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001662734</rptOwnerCik>
            <rptOwnerName>Moorjani Janesh</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O ELASTIC N.V.</rptOwnerStreet1>
            <rptOwnerStreet2>88 KEARNY STREET, FLOOR 19</rptOwnerStreet2>
            <rptOwnerCity>SAN FRANCISCO</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>94108</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>CFO &amp; COO</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Ordinary Shares</value>
            </securityTitle>
            <transactionDate>
                <value>2023-12-08</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>39288</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>169242</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Ordinary Shares</value>
            </securityTitle>
            <transactionDate>
                <value>2023-12-11</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F3"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>6930</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>114.97</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>162312</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Ordinary Shares</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>44474</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By trust</value>
                    <footnoteId id="F4"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">The ordinary shares are represented by restricted stock units (&quot;RSUs&quot;), which vest in sixteen equal quarterly installments beginning on March 8, 2024.</footnote>
        <footnote id="F2">Includes 452 ordinary shares purchased under the Issuer's Employee Stock Purchase Plan on September 15, 2023.</footnote>
        <footnote id="F3">The ordinary shares were sold to satisfy the Reporting Person's tax obligations in connection with the vesting of RSUs. This sale was mandated by the Issuer's equity incentive plan which requires the satisfaction of tax withholding obligations to be funded by a &quot;sell to cover&quot; transaction and does not represent a discretionary trade by the Reporting Person.</footnote>
        <footnote id="F4">Held by a family trust of which the Reporting Person and his spouse serve as trustees.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Marielle Reints, by power of attorney</signatureName>
        <signatureDate>2023-12-12</signatureDate>
    </ownerSignature>
</ownershipDocument>
